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

String manipulation and parsing

Status
Not open for further replies.

malladisk

Programmer
Jun 14, 2001
69
US
Hi!
Does VB support easy string manipulation? Specifically, I need to be able to read one character at a time from a file, so that I can parse the contents of the file. Is there a getc function?
Thanks,
Sashi
 
You need to do some research on instr(), mid(), left() and right(). These are VB's string manipulation functions.

Hope that helps,
Erica
 
Sashi
You can use the Input function to read one character at a time from a file.
 
Do you really need to read ONE character at a time to parse a file? If the file is a text file, then you better have a look at my solution to a similar (but limited to the first word of a line) problem posted in thread222-109781.

The code can easily (?) be adapted to more complex parsing. _________________________________
In theory, there is no difference between theory and practice. In practice, there is. [attributed to Yogi Berra]
 
rvBasic is correct, it is inefficient to read text files byte by byte. The concept needs to be:

Get it. (As much as you can)

Process it. (However you may)

You need to rember the relative speed of the parts of your system:

Define Memory access as 1.

(Hard) Disc Access is 1/10

(Floppy) Disc (Removable Nedia - in General) is 1/100


MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top