473,217 Members | 1,954 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,217 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 3193
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.