You are here: FME Readers and Writers > CSV (Comma-Separated Value) Reader/Writer > Reader Overview

Reader Overview

The CSV reader produces an FME feature for each line in each the CSV files residing in the given directory. The CSV reader first scans the directory 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 directory. 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.)

Creating Spatial Features

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.

Point Features

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.

3D Features

Use a 3dPointReplacer transformer.

Line Features

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.

Polygon (area) Features

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.