Splitting an ArrayList
-
Hi, I have an ArrayList which was populated by a text file with no column headers. What I want to do is split the ArrayList into columns then display it in a datagrid. The ArrayList is made up of lines such as 0168EH1X.PA0 020 1 GRA_ 08/14/06 12:16:42 I need to split this into 5 columns under the headings ID, Duration, Status, Channel and DateTime. I've been trying to do this with the .SubString method but no luck. I know how to define the columns in the grid but I can't split the ArrayList up. Please can anyone help? Thanks Scott
-
Hi, I have an ArrayList which was populated by a text file with no column headers. What I want to do is split the ArrayList into columns then display it in a datagrid. The ArrayList is made up of lines such as 0168EH1X.PA0 020 1 GRA_ 08/14/06 12:16:42 I need to split this into 5 columns under the headings ID, Duration, Status, Channel and DateTime. I've been trying to do this with the .SubString method but no luck. I know how to define the columns in the grid but I can't split the ArrayList up. Please can anyone help? Thanks Scott
Hello Is your ArrayList an array of strings each on the above format?
Regards:rose:
-
Hello Is your ArrayList an array of strings each on the above format?
Regards:rose:
-
Hi, Yes, it is. Anywhere between 10 and 150 strings. The format for each string is identical.
scotlandc wrote:
0168EH1X.PA0 020 1 GRA_ 08/14/06 12:16:42 I need to split this into 5 columns under the headings ID, Duration, Status, Channel and DateTime.
Simple! use
MyArrayList[X].ToString().Split(' ');
to get an array of strings of each column.
Regards:rose:
-
scotlandc wrote:
0168EH1X.PA0 020 1 GRA_ 08/14/06 12:16:42 I need to split this into 5 columns under the headings ID, Duration, Status, Channel and DateTime.
Simple! use
MyArrayList[X].ToString().Split(' ');
to get an array of strings of each column.
Regards:rose: