I need to put data exported from ArcMap as a .csv file into a 2-d array in VB. The file is a 1800x1800 matrix so it is impossible to put it in a worksheet and manipulate it from there. Does anyone know how I could read the .csv into a 2-d array so that I can lookup any value?
I suppose the simplest, though not necessarily the most efficient method, would be to just read the file line by line and use the
Split() function to separate it on the commas. This will require more work on your part if you can't guarantee the data values won't also include commas. CSV handles this eventuality easily, but if it is possible you may encounter it, then you may need to actually loop through each line, character by character, and separate the fields yourself.
On the other hand, if you are using VB.Net, it may have added functionality that I'm not aware of, to handle a CSV import.
By the way - is CSV the only format available? If not, what others could you use? For example, tab-delimited data would be just as easy to process, but would overcome any problems of running into commas within the data.