Jcrouse,
I would do as Armin suggested in your other thread. Create a parser
(Serializer) to parse the file format into an object model. Then check the
object model.
Instead of an object model, I would also consider creating an XPath
navigator for your file format, then extract the data using XPath
statements.
http://msdn.microsoft.com/msdnmag/is...s/default.aspx
Creating an XPath navigator also enables you to convert the file format into
XML, which may or may not be more manageable (editable) then the current
format.
You might be able to use Regular Expressions to help create a parser, or at
least to extract a specific line of the description.
A tutorial & reference on using regular expressions:
http://www.regular-expressions.info/
The MSDN's documentation on regular expressions:
http://msdn.microsoft.com/library/de...geElements.asp
Hope this helps
Jay
"jcrouse" <anonymous@discussions.microsoft.com> wrote in message
news:168630F0-9615-4EA6-AD19-9208016E927F@microsoft.com...[color=blue]
> Here is a sniplet from a text file:
>
> game (
> name mappy
> description "Mappy (US)"
> year 1983
> manufacturer "Namco"
> history "\nMappy (c) 03/1983 Namco. \n\n- TRIVIA: \n\nLicensed to Bally[/color]
Midway for US manufacture and distribution. (03/1983) \n\n- SERIES: \n\n1.
Mappy \n2. Hopping Mappy \n\n0.26 [Aaron Giles, Mirko Buffoni] \n\nBugs: \n-
\"000\" is displayed on the highscore. If you get more than 30000 pts, it is
displayed normally. This happens whether there are \"hiscore.dat\", hi file
and cfg file or not. mappy37b4gre Fujix \n- In Mappy (both versions, mappy
and mappyjp), if you insert at[color=blue]
> rom ( name mp1-5.5b size 32 crc 56531268 sha1[/color]
2e356706c07f43eeb67783fb122bdc7fed1b3589 region proms offs 0 )[color=blue]
> rom ( name mp1-6.4c size 256 crc 50765082 sha1
> chip ( type cpu name M6809 clock 1536000 )
> chip ( type cpu name M6809 clock 1536000 )
> chip ( type audio name Namco_15XX )
> video ( screen raster orientation vertical x 224 y 288 aspectx 3 aspecty 4[/color]
freq 60.606060 )[color=blue]
> sound ( channels 1 )
> input ( players 2 control joy8way buttons 1 coins 2 )
> dipswitch ( name "Cabinet" entry "Upright" default "Upright" entry[/color]
"Cocktail" )[color=blue]
> )
>
> I will have a variable containing the text string that matches the second[/color]
line, "name mappy".[color=blue]
>
> I would then like to find the line that begins with "video" and retrun one[/color]
of the parameters that follow. It will be the one after the word
"orientation" and it will be either "vertical" or "horizontal". I the want
to set a variable to either "v" or "h" so I can apply my code. It's a pretty
large text file, about 30MB. What is the best way to do this? The other day
I was able to get a number to return that was the character number of the
first string, but I got stuck after that.[color=blue]
>
> Thank you,
> John[/color]