Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
910
Import delimited data into grid (VB .NET)
posted

I am interested in the fastest, easiest way to import a text file into the grid. These text files contain an indeterminate number of rows and columns. Data in each row is delimited, in that if there are let's say 10 columns, you're going to have 10 values delimited by 9 delimiters.The delimiter character is also dynamic, passed into the app as an argument - so, it can be anything from a tilde to a comma to a tab. I want to iterate through the text (which I've put into a list via filestream, though if there's a better way...), then parse each field (ie. traverse the delimiters), and throw it into a cell in a grid.

so, say a csv file like the one below would result in a grid with 3 rows and 4 columns:

aaa,123,554,221

bbb,432,555,23

jjj,5455,333,1

thanks