Resources

Knowledge Base

How to extract Column Headers in a CSV file

The Read CSV File activity extracts data from a CSV file using a dataTable format. The first line in the CSV file is automatically considered as the column header. The first line is usually not included during the extraction.

However, if you wanted to include the column headers, follow these simple steps:

columnheaders1

1. Start with the Read CSV File Activity. Specify the path of the CSV File.

2. Add a For Each Activity to scrape the items in each column in this sequence: For each column in dataTableReadCsvFile4.Columns

The dataTableReadCsvFile4 is the dataTable where the extracted data is stored from the test.csv file. This can be found in the Output section of the of the test.csv file.

3. Add the Write line activity to print the results column.ColumnName. You can also use this output in other activities or actions.