|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
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
|
|||
|
|||
|
Getting lines from a text files
Hi, I know how to get line 1 from a text file, but how do I get the others. Like Line 1 goes to text1, line 2 goes to text2 and so on. Any help???
|
|
#2
|
||||
|
||||
|
use the eof() function with a loop to read through the text file.
Code:
public sub getFile(byVal fileName as String)
dim iFp as Integer
dim strFileLine as String
iFp = Freefile
Open fileName for Input as #iFp
while not EOF(iFp)
Line Input #iFp, strFileLine
'do what you want with the line
wend
Close #iFp
end Sub
***untested code*** |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Getting lines from a text files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|