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!

Parsing a semi-random file

Status
Not open for further replies.

BFP

Technical User
May 18, 2000
52
US
Hi All.

I am trying to parse a file in which the only known things are the keywords I wish to parse for (of which there are several), the fact that the keyword and the value of the keyword are separated by a space, and that there will be one or more right parens ")" then a left paren "(" before the next keyword. Of course there is the added complication that the keywords are case insensitive.

For example, I may wish to parse the version number form "version", the level number from "level", and several names from "name" from something similar to that below.

...junk(version 9 8 7)(level 20))(junk junk)(junk junk))))...(name ABC)(junk junk)(name DEF)...))))... EOF

Now take the above and multiply by a few million lines and the fact that there are several other keywords I would like to grab, you can see the complication.

Is there an efficient method to grab the desired keywords?

An example would be great.

Thanks in advanced.

--D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top