I have a similar requirement to this post…
Populate Gridview at runtime using textfile
Where I want to read a text file with StreamReader and populate a DataTable with the data in the file, however I’m not sure how to implement a split() with a tab.
Could anybody point me in the right direction, please?
You can try this:
I presumed that rows are delimited by newline (if that’s the case
ReadAllLinesmethod can be used). Number 9 is the ASCII value for horizontal tab character and it is used for splitting the line.ForEachis a method that can be used on generic lists, it is there instead of theforeachloop.