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 through a text file

Status
Not open for further replies.

sshafe

Programmer
Oct 18, 2002
71
US
Let me start by defining the purpose of my script.

I am writing a VB script that will read in a text file and update a database with the information. If the first word of the line is ADD, I want to insert a row. If the first work is DELETE, I want to remove it from the database.

My question is: is it possible to read through a text file with an IF statement.

IF
ADD .....
THEN
UPDATE
ELSE IF
DELETE
THEN
REMOVE FROM DB
ELSE
ERROR MESSAGE
END IF


Thanks :)

 
I've decided that I need to read the file in by character. Is there a way to do a check to determine when a tab or newline character is hit? The code I've tried comes back with syntax error

Do while Var <> Chr(09)

Help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top