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

How to specify a delimiter in a input # function

Status
Not open for further replies.

anuktac

Technical User
Aug 1, 2002
48
0
0
IN
Hi,
I need to get a list of variables using the imput # function from a file having fields separated by "~". Does anyone know how to do this?

Input #1, Sac, Sac_Desc, District, Site, Time_Period, Call_Type, Call_Group, No_Of_Calls, Revenue, Duration, Dummy

The above are the list of variables. But the syntax does not seem to accept anything other than "," as a delimiter.
Any way around this?

-Thanks
Anukta
 
You could use ADO to connec to the file as a data source then use SQL to retrieve the data into a recordset.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Depending on the file size and structure, you can try to use Input or Line Input and next use Split function with delimiter set to "~". If it fails, you will probably have to analyse string using Instr function.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top