Decode CSV

Decodes CSV format to JSON format

The Decode CSV action decodes data in CSV format. When applied to your processing rule, the Decode CSV action will convert your CSV data to JSON format in your pipeline. The Decode CSV action will convert the record form a source record to a destination record in your pipeline. action

For example, given the following sample website CSV log data.

timestamp,user_id,page_id,action
2023-03-28T09:08:41.64283645Z,3,30,purchase
2023-03-28T09:08:42.643343109Z,4,10,purchase
2023-03-28T09:08:48.643600498Z,1,50,click
2023-03-28T09:08:50.643773688Z,5,40,purchase
2023-03-28T09:08:51.643932272Z,1,30,purchase
2023-03-28T09:08:56.644080944Z,2,40,click
2023-03-28T09:09:03.64425954Z,3,30,click
2023-03-28T09:09:03.644317046Z,1,20,view
2023-03-28T09:09:10.64447719Z,2,50,purchase
2023-03-28T09:09:17.644810963Z,2,10,view
2023-03-28T09:09:20.644994805Z,1,50,view

To decode the data from CSV format to JSON, from the actions drop-down menu of your processing rules tab, select Decode CSV. Add a source key “log” to name the source record and a destination key, “decoded_csv” to name the decoded data and click Apply.

Your processing rule will now convert every record in your pipeline from CVS format to JSON format. It will also add the “log” key to each CSV record and a “decoded_csv” key to the converted record. Check the parseHeader option, if you want the first row of parsed CSV treated as the header, and subsequent rows will be parsed as key/value pairs. If not, the data will be parsed as array of values.

Checking the paserHeader will give the following result.

\

Last updated