By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,046 Members | 2,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,046 IT Pros & Developers. It's quick & easy.

Split multi dimension

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
* 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

P: n/a
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.