Use the New CSV Input Stream step type to open a CSV file for reading and store a reference to it. In addition to specifying the path to the input file, you can specify a tag to search for and/or some number of lines to skip. These options enable reading from files that are not completely homogenous. For example, it is common for a CSV file to have metadata at the top (the date, time, operator id, location, etc.) followed by column headers, and then the main data table. The combination of scanning for a specific string and/or skipping a fixed number of lines allows the New CSV Input Record Stream step type to prepare such a file for reading with a for each loop. You can use the API to read more complex files.

After you open a CSV file, you can iterate over its rows using the For Each step type. Each iteration of the loop reads one row of the CSV file and stores the data in a container or array you specify. If you specify a container, the container represents a row, and each subproperty corresponds to a column. If you specify an array, the entire array represents a row, and each array element corresponds to a column. The loop continues until the For Each step encounters a blank line or the end of file.
Note   Because the For Each step reads only a single record during each iteration, it is possible to iterate over large CSV files. The loop itself requires only enough space to store a single row of data.

You must close the CSV file when you are finished. You can close the CSV file by calling the InputRecordStream.Close() method through the API. Alternatively, you can configure the For Each step type to close the file automatically when the loop terminates.