468,738 Members | 2,392 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,738 developers. It's quick & easy.

Split multi dimension

Hi!

I have a list of data in a textfile which is tab delimited. Each line is
seperated by a VbCrLf. I want to collect this data in a multidimensional
string array. I do not wish to use a database or a Disconnected ADO
Recordset since this is just passing data along to be written into an XML
file...

I've figured out how to split the data line by line by doing a

asSysLogLines = Split(Me.sLogText, vbCrLf, , CompareMethod.Text)
but i want to split up the data in each of this arrays field..

the data is like asSysLogLines(0) = Username <TAB> I.P <TAB> LOCATION <TAB>
Message
How can i split this up so that this becomes a multidimensional array so
that i can keep all the data in one array an easily access the fields ?

Thanks
Nov 20 '05 #1
3 3020
Cor
Hi Jan,

See what you can do with this sample I made once, I saw you know how to
split it, so with this it should be easy.
\\\
Option Strict On
Public Module Main
' Sample of an arraylist that itself contains 10 classic arrays.
Public Sub Main()
Dim a As New ArrayList
Dim B() As Integer = {1, 2, 3, 4}
For i As Integer = 0 To 9
a.Add(B)
Next
MessageBox.Show(DirectCast(a(9), IList)(2).ToString)
'With option strict off you do not
'have to use the directcast and than it is
'MessageBox.Show(a(2)(2).ToString) 'but I would not do that
'I show this to make it more classic looking for you.
End Sub
End Module
///
I hope this helps a little bit?

Cor
I have a list of data in a textfile which is tab delimited. Each line is
seperated by a VbCrLf. I want to collect this data in a multidimensional
string array. I do not wish to use a database or a Disconnected ADO
Recordset since this is just passing data along to be written into an XML
file...

I've figured out how to split the data line by line by doing a

asSysLogLines = Split(Me.sLogText, vbCrLf, , CompareMethod.Text)
but i want to split up the data in each of this arrays field..

the data is like asSysLogLines(0) = Username <TAB> I.P <TAB> LOCATION <TAB> Message
How can i split this up so that this becomes a multidimensional array so
that i can keep all the data in one array an easily access the fields ?

Thanks

Nov 20 '05 #2
* Jan Hanssen <ja********@hassan.se> scripsit:
I have a list of data in a textfile which is tab delimited. Each line is
seperated by a VbCrLf. I want to collect this data in a multidimensional
string array. I do not wish to use a database or a Disconnected ADO
Recordset since this is just passing data along to be written into an XML
file...

I've figured out how to split the data line by line by doing a

asSysLogLines = Split(Me.sLogText, vbCrLf, , CompareMethod.Text)
but i want to split up the data in each of this arrays field..

the data is like asSysLogLines(0) = Username <TAB> I.P <TAB> LOCATION <TAB>
Message
How can i split this up so that this becomes a multidimensional array so
that i can keep all the data in one array an easily access the fields ?


First determine the number of lines and columns (for example, by
analyzing the 1st line after splitting all the lines), then create the
2D-array, split the lines and insert the data into the big array.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Thanks a lot Cor

NEAT!!
"Cor" <no*@non.com> wrote in news:eR**************@TK2MSFTNGP12.phx.gbl:
Hi Jan,

See what you can do with this sample I made once, I saw you know how
to split it, so with this it should be easy.


Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Stephen Patten | last post: by
6 posts views Thread by Adam Hartshorne | last post: by
reply views Thread by Hai Ly Hoang | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.