Solved

Retrieve value from CSV Column Header

  • 18 March 2020
  • 2 replies
  • 26 views

Badge +3

Hello,

I need to retrieve the value of a column header in a CSV file. The column header contains the ID of a meter I need to use as an insert into a database. Unfortunately I can't use a filepathreader as the id filed isn't included.

 

Any idea how I might do this? I have attached a test file. The value I need to extract from the column header is the string after the undescore.

icon

Best answer by ebygomm 18 March 2020, 11:25

View original

2 replies

Userlevel 1
Badge +21

If you read the csv without a field names line so your attributes are returned as col0 and col1, the first record will contain the value in col1 and you can use a string searcher with some regex to return the value.

Badge +3

Brilliant - thank you!

Reply