I want to read values from text file and insert them to 2 arrays, the first column to one array and the second column to another array.
For example:
Text file: 0x223 0x2342342 0x21323 0x983298 0x908938 0x8382AA arr1 : 0x223, 0x21323 , 0x908938 arr2 : 0x2342342,0x983298,0x8382AA
How can I do it?
This question is related to
c#
var Text = File.ReadAllLines("Path"); foreach (var i in Text) { var SplitText = i.Split().Where(x=> x.Lenght>1).ToList(); //@Array1 add SplitText[0] //@Array2 add SpliteText[1] }
Source: Stackoverflow.com