473,388 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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 3210
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephen Patten | last post by:
Hi All, While in the process of building my table (40 or so Insert statments) can I then query ("select * from @Table_variable") and use the results up to theat point for another insert into...
9
by: Steve Jorgensen | last post by:
Hi all, I'm working on the schema for a database that must represent data about stock & bond funds over time. My connundrum is that, for any of several dimension fields, including the fund name...
1
by: sugaray | last post by:
I don't get why the correct way to allocate memory space for 3d-array should be like this in C++: long (*ptr); ptr=new long; and when deallocation delete ptr;
6
by: Adam Hartshorne | last post by:
The input to a function of a 3rd party library I want to use requires a double**, which is a multi-dimension array of doubles. I have looked on the net etc and seen several ways of supposedly...
8
by: masood.iqbal | last post by:
All this time I was under the illusion that I understand the concept of multi-dimensional arrays well ---- however the following code snippet belies my understanding. I had assumed all along...
11
by: truckaxle | last post by:
I am trying to pass a slice from a larger 2-dimensional array to a function that will work on a smaller region of the array space. The code below is a distillation of what I am trying to...
0
by: Hai Ly Hoang | last post by:
Hi, I'm using VC++ 7.0 (VS 2003). My code: void main() { int *a = new int; } I'm sure that the above code is accepted by VC++ (no compiling error). What is exactly the semantic of the above...
4
by: rmorvay | last post by:
I have a requirement to search a multi-dimensional array for an item, then delete the item and "reset" the array so that their are no gaps in the resulting array. I have been trying to figure out...
7
by: nw | last post by:
Hi, We've been having a discussion at work and I'm wondering if anyone here would care to offer an opinion or alternative solution. Aparently in the C programming HPC community it is common to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.