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!

Look For " "

Status
Not open for further replies.

M626

Programmer
Mar 13, 2002
299
I am reading in a line and copying Mid(ldata, 4,10) for output to another file but is there a way I could copy everything between the 1st " and 2nd "

the line looks like this

"00 this is a test"
 
yeah, you can use instr

Code:
   intTemp0=instr(strTemp0,chr(34))
   intTemp1=instr(intTemp0+1,strTemp0,chr(34))

   strTemp1=mid(strTemp0,intTemp0+1,intTemp1-intTemp0)

...

Remember to make the appropriate checks for intTemp0 and intTemp1 being =0. That is, make sure some idiot didn't screw up the data.

HTH
 
You can also use a regular expression "Every day is like a precious gift, you have to make it count" James Birrell 1994-2002
 
LOL If somethings hard to do, its not worth doing - Homer Simpson
 
oops pressed too early, what i really meant to say was strongm you should really write an faq on reg exp!! If somethings hard to do, its not worth doing - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top