Reading files with headers provided as rows & not as columns

How can I read files in the below format (where column headers are provided as rows in the start of the file and data is appended at the bottom of the file which is delimited using pipe)
My objective is to convert this into a table with 3 columns where the column names are as shown as in the section between START-OF-FIELDS & END-OF-FIELDS

START-OF-FIELDS
USER_NAME
AGE
GENDER
END-OF-FIELDS
START-OF-DATA
John|23|Male
Clara|32|Female
Benny|10|Male
END-OF-DATA

Yes, you could do that. You first import the whole file. There you find where the first data line starts. Indicated by the presence of the separator “|”. Then you separately import the data and then the headers and then construct a lookup table that you can use with the Insert Column Header node

kn_example_import_txt_header.knwf (51.2 KB)

4 Likes

Wow, excellent. Many thanks for helping out, really appreciated

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.