Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading text file records 2

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
GB
i need to create some code that will read a record from a file and execute a macro. then loop the remaining records doing the same thing. so the file will have fields account,date,note. which should then be applied to the corresponding account.

Im a total newby to this and only managed to get the code to do simple things. So it needs to explained in basic terms. thanks

"My God! It's full of stars...
 
Use the Open command, then the input command. Each input gives you the next line of the text file.

Open "c:\myfile.txt" for input as #1

Do while EOF(1) <> True
'continue until the End of the File is reached
Input #1, RawData
'Your record is now in this variable
'You can also use this if the file is formated properly:
'Input #1, Account, Date, Note

POOF!
Magic Happens Here

Loop
close

Read the help files about the Open and close commands.

calculus
 
Calculus,

Thanks, just the jump point i was looking for.

"My God! It's full of stars...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top