|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Reading a text file into an array
Hi, I have a simple text file comprising 96 variables separated (by tab) into 8 lines and 12 columns.
I would like to read them into arrays of MTT(x,y) from x = 1 to 12 and y = 1 to 8. While Not EOF(1) For y = 1 To 8 For x = 1 To 12 Line Input #1, Eachline i = Val(InStr(i, Eachline, Chr(9), 1)) - i MTT(x, y) = Val(Left(Eachline, i)) Next Next Wend Something is obviously wrong but I tried many different combis to no avail. The example above is just one of the futile attempts. Please advise. |
|
#2
|
|||
|
|||
|
Thanks, solved using the split() function. First splitting each line with the tab-delimiter, then reading each value into the array using a loop.
|
|
#3
|
|||
|
|||
|
Hi can you help
I am also having the same situation where i need to get some names from a textfile which are separated by tab ...
Actually i am not familiar with file handling Can you tell me the code to open the file and the path settings please...... arjun |
|
#4
|
|||
|
|||
|
Can you
Hi,
Could you tell me the solution for the following : I have a text file in c:\test.txt which has number of names separated by tab, I want to get those names in to an array.... Actually i am not familiar wiht file handling can you please tell the codings from begining, like fiel open, path and read etc.... thanx arjun |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Reading a text file into an array |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|