We Use Cookies

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with this.

See our cookie policy.

Automation Action: Read CSV

Read a CSV file or variable containing CSV data.

Built-In Action

Read a CSV file or %variable% containing CSV data and assign the CSV data to a variable.

This action allows you to read a CSV file (or a %variable% containing CSV data). You can optionally delete columns from then returned CSV data and sort by a column. The column delimiter character and line endings will be automatically detected when the CSV is loaded. However the returned CSV data will always use a comma as the delimiter. Any date & datetime values will be automatically normalized to date format yyyy-MM-dd HH:mm:ss in the returned CSV data.

Specify the CSV File Name or Variable. This field can contain a file path (or %variable% containing a file path) or a %variable% containing CSV data.

Enable the Has Header Row if the CSV data contains column headers on the first row.

Deleting Columns

You can optionally delete columns from the returned CSV data. Specify a comma separated list of column header names, or column numbers (starting at 1). The source CSV file/data is not changed - this setting only affects the CSV data that is returned.

Deleting Last Rows

You can optionally delete the last x rows from the returned CSV data. Specify the number of rows to remove in the Delete Last Rows entry. For example, if this is set to 2 then the last 2 rows will be removed (before any sorting). This can be useful if you have extracted the CSV data from an Excel file (using the Lookup From Excel action) and the CSV data contains additional summary rows at the end. The source CSV file/data is not changed.

Sorting

You can sort the returned CSV data by a column. Specify the column header name or column number (starting at 1) in the Return Sorted By Column entry. You can select to sort Ascending or Descending. If you use column number here then the number relates to the new CSV columns after any columns have been deleted.

Return Top Rows

You can choose to only return the first x rows (after any sorting). Leave this entry at zero for all rows.

Return Header Row

Disable this setting if you do not want the column header row included in the returned CSV data.

Select the %variable% to receive the CSV data from the Assign CSV Data To list.