I have a textfile with the format:
FieldName1: value\t
FieldName2: value\t
FieldName3: \t
FieldName4: value\t
FieldName5:
value value value value
value value value value
value value value value
value value value value
\tFieldName6: value\t
Field values have the delimiter '\t' to identify the end of a field definition. In the example, there are two special cases: an empty value and a value that spans across multiple lines.
Is there a way to read in a textfile and split each element by the delimiter '\t'? I've tried playing around with File.ReadAllLines(filePath) and it just splits the file line by line.
You can split the text in the file with the delimiter \t like this:
string [] fileds = File.ReadAllText(filePath).Split("\\t");
Same as the answer above, bu you need to escape the \t .