I have a specific Textfile:
197 17.16391215
198 17.33448519
199 17.52637986
200 17.71827453
201 17.9101692
202 18.10206387
203 18.29395854
204 18.48585321
205 18.67774788
206 18.86964255
207 19.06153722
and so on. To be clear: First column (197,198,..) indicates a framenumber and the second column (17.xxx,...) indicates a position linked to the framenumber, and vice-versa.
Now I want to separate each Line in different Arrays. With
string[] delimiters = new string[] {" ", "\r\n" };
string line = reader.ReadToEnd();
string[] test = line.Split(delimiters, StringSplitOptions.None);
I got one Array with all the entries from the Textfile. But I want all framenumbers (first column) in one Array and in another second Array all positions.
My job I have to do is as follow: I will get a position number (e.g. 18.10) then I have to search in the .txt file in the second column for the nearest matching number and return the linked framenumber (in this case 202). My idea was to generate two matching arrays, search in one for the position and returning from the other for the framenumber. As I searched half a day on the internet I found many things like all the .select stuff, but not anything matching directly do my problem; but maybe I am to dumb at the moment.
So thanks for any help. Hopefully you can understand my English :P