If I have a text file that has a header record and field delimited by a pipe “|” something like –>
Column1|Column2|Column3\n
A|B|C\n
E|F|G\n
1|2|X\n
Is there a way I can determine if the header record exists in the file programmatically? The catch is that the headers aren’t always consistent (so, Column1 may be called Column100 in some files)
Only way i know: header row fields are almost certainly words (text), data rows are in different data types (by columns). So, if there are columns by types but not same type in first row, the header is present.
You need some kind of data-type tester and about 5 rows from this text file to get it clear.