cancel
Showing results for 
Search instead for 
Did you mean: 

Get column headers from within the file

philliperamos
Contributor

Good day all,

I have a .txt file that looks like:
image

All the rows have the “header” info before the value.
e.g. Column Ordinal: 13 Expected Data Type: Date

Every row has the same info. (e.g. Column Ordinal, Expected Data Type, etc.)
I would like to have the values with their respective columns by getting the value using the : as a separator between header info and value.

I don’t know if this makes any sense, but let me know if you need any clarification as to the problem.

Thanks.

2 REPLIES 2

jovan_j
New Contributor III

Hi philliperamos,

You can use mapKeys and mapValues function to extract the values from the file (the first mapper extracts the Keys, the second mapped extracts the Values), also make sure to unchecked the Columns header option in the CSV parser. Please see attached screenshot and pipeline. Hope this helps.

Regards, Jovan.JJ new pipeline 123_2019_11_06.slp (7.2 KB) Screenshot_1

Thanks @jovan.j for the reply/suggestion. I’ll give it a try with my source file.