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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read text file

Status
Not open for further replies.

earlrainer

Programmer
Mar 1, 2002
170
IN
Hi ,

i am new to VB so please help.

i have a fixed length text file with the following format
itemnumber price
itemnumber length 13
price length 9

can you show me how to write a function that accepts as input a itemno
then it searches for the itemno in the file
if found it returns the price
else if item not found then it returns -1

also is there a faster way to read the text file by converting it into binary file maybe?
 
earl,

Have you looked at VB help? Look for Input, Input # and Line Input #.

Basically you'll open the file, input a line, test the input, when your test is true, close the file and return the value.

Hope this helps :)

Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top