Difference between revisions of "Component: CSV Read/Write (File)"
Line 75: | Line 75: | ||
The component requires linking to a File component to provide access to the file system for simulation and runtime, this could be the File SD, File RPI or File AppDeveloper components. | The component requires linking to a File component to provide access to the file system for simulation and runtime, this could be the File SD, File RPI or File AppDeveloper components. | ||
+ | |||
+ | |||
Line 80: | Line 82: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===CloseFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 93: | Line 96: | ||
+ | ===SequentialReadString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 106: | Line 110: | ||
+ | ===AddString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 124: | Line 129: | ||
+ | ===ReadAsString=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 147: | Line 153: | ||
+ | ===SequentialReadNumber=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 160: | Line 167: | ||
+ | ===AddNumber=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 178: | Line 186: | ||
+ | ===ReadAsNumber=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 201: | Line 210: | ||
+ | ===SetSequentialIndex=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 219: | Line 229: | ||
+ | ===OpenFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 242: | Line 253: | ||
+ | ===NextRow=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:48, 3 February 2023
Author | Matrix TSL |
Version | 1.0 |
Category | File |
Contents
CSV Read/Write component
A component to simplify the task of creating and dumping data to a CSV file that can be loaded into Microcoft Excel or LibreOffice Math to create nice charts and graphs. Requires one of the File components to provide access to the file system.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_CSV_Writer.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_CSV_Writer.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Simple example file to generate a two column CSV file that can be loaded into Microsoft Excel or LibreOffice Math.
CSV Component used with Embedded -> File SD component:
CSV Test
CSV Component used with Embedded -> File RPI component:
CSV Test RPI
CSV Component used with App Developer -> File component:
CSV Test AD
The component requires linking to a File component to provide access to the file system for simulation and runtime, this could be the File SD, File RPI or File AppDeveloper components.
Macro reference
CloseFile
![]() |
CloseFile |
Closes the file and finishes off any pending writes ready for use in an external application. | |
![]() |
Return |
SequentialReadString
![]() |
SequentialReadString |
Reads the contents of a cell as a string. Automatically moved to the next data cell after a read. | |
![]() |
Return |
AddString
![]() |
AddString |
Adds a string to the CSV followed by a comma. This will form a single column of data in the CSV file. | |
![]() |
data |
![]() |
Return |
ReadAsString
![]() |
ReadAsString |
Reads the contents of a cell as a string | |
![]() |
Column |
![]() |
Row |
![]() |
Return |
SequentialReadNumber
![]() |
SequentialReadNumber |
Reads the contents of a cell as a number. Automatically moved to the next data cell after a read. | |
![]() |
Return |
AddNumber
![]() |
AddNumber |
Adds a number to the CSV followed by a comma. This will form a single column of data in the CSV file. | |
![]() |
data |
![]() |
Return |
ReadAsNumber
![]() |
ReadAsNumber |
Reads the contents of a cell as a number. | |
![]() |
Column |
![]() |
Row |
![]() |
Return |
SetSequentialIndex
![]() |
SetSequentialIndex |
Sets the index for sequential reads. Index is automatically reset to 0 after a file open. | |
![]() |
Index |
![]() |
Return |
OpenFile
NextRow
![]() |
NextRow |
Move to the next row in the file | |
![]() |
Return |
Property reference
![]() |
Properties |
![]() |
LinkTo |