4
Answers

Read a column based text file into array by c#

yamid

yamid

14y
9.5k
1
Hi Guys,
I have a text file (tab/space,comma delimited) with some header. maybe we have some free space line need to be ignored . I want to store them in some arrays for example~:

#Header of the file
#data are double
#x , y, z, i, j
122 1222 122 45 23

12 188 85 65 25
18 58 454 545 58
23 45 87 52 32
...

I want to have this arrays:
X[]={122 12 18 23 ....}
y[]={1222 188 58 45 ...}
z[]={122 85 454 87 ...} and the same for i,j array.
or this array:
A[][] in which the inner array is from 0 to 4 representing ( x,y,z,i,j) and the second jagged part is the corresponding data.

Thanks

Answers (4)