FME provides reader and writer access to files in CSV format.
Comma-Separated Value, or CSV, is a way to store structured information in an ASCII file format, making it a very simple database. CSV is a popular format for exchanging information between spreadsheets, databases, and other software applications.
In FME, CSV is treated as a database format. Each line in the file is a record, with a comma (or other) character between each field within the record.
There is often a header line to provide names for the fields. For example:
company, address, telephone, web
Safe Software Inc, 132nd Street Surrey BC, 604-501-9985, www.safe.com
Files do not have to be comma-separated: FME can recognize any file with any separator or delimiter character, as long as you specify that character in the parameter settings.
The CSV reader produces an FME feature for each line in each the CSV files residing in the given folder. The CSV reader first scans the folder for all CSV files that are defined in the workspace.
If IDs lines are specified, the CSV reader processes only the specified files; otherwise, it reads all files in the folder. Optionally a single CSV file can be given in the workspace. In this case, only that CSV file is read.
The CSV reader can also read data consisting of fixed width columns without a separator, provided that the character spacing the data (usually a space character) does not appear in the data itself. Use the parameter Remove Duplicate Separators. (An alternative method is to use the Textfile reader and an AttributeSplitter transformer.)
CSV files often contain spatial data listed as a series of X/Y coordinates. To turn these non-geometry features (records) into spatial features, you must use FME transformers.
Use a 2DPointReplacer transformer to replace each record with a point feature using X/Y or Lat/Long values stored in attributes to create the coordinate of the point.
Each point feature retains all the attributes of the original non-geometry feature.
Use a 3dPointReplacer transformer.
This is a two-step process:
Optionally, you can specify an attribute carrying the line ID number as a way to break the features at the start of each line.
Turn the records into line features using the process described above.
If the last point is the same as the first then an area feature is automatically created.
The CSV writer writes all attributes of a feature to an CSV file. Features of different types are written to different CSV files.
To turn records into spatial features, see the tips in the CSV format overview.
To view non-spatial data in the Data Inspector application, select Tools > Select All Features with No Geometry.
A common user requirement is to convert data held as plain X/Y coordinates into true spatial features. However, sometimes the opposite is required: spatial features must be converted into a plain text, comma-delimited (CSV) file. This FME Knowledge Center article gives details.
FME Knowledge Center