|
-
Jun 12th, 2002, 06:01 AM
#1
Thread Starter
New Member
.csv file into an array
Help...
I have a large .CSV file containing numbers only.
I can import it into a VB text box to get a string of numbers like:
2,45,623,55,3,6,,,,etc.
However I need to break the data up and put it into an array so it looks like:
2,45,623
55,3,6
,,,,,etc
Any Ideas?
-
Jun 12th, 2002, 06:06 AM
#2
Junior Member
hello
Might be a good idea to create a import spec and pass all numbers into a table. From this you could create a query to get the desired results and thus output them to your list box!
-
Jun 12th, 2002, 06:14 AM
#3
This should do the trick !
Code:
Dim strCSVFileText As String
Dim straryCSVFileLines() As String
Dim intCounter As Integer
intCounter = 0
Open "C:\TestCSVFile.csv" For Input As #1
Do While Not EOF(1)
ReDim Preserve straryCSVFileLines(intCounter)
Line Input #1, straryCSVFileLines(intCounter)
intCounter = intCounter + 1
Loop
Close #1
-
Jun 12th, 2002, 06:34 AM
#4
Addicted Member
This is a good web site for quick code. They have just added some parse CSV code.
http://www.xbeat.net/vbspeed/index.htm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|