0

Hi,

I'm trying to read certain values from a text file and store them in a variable/string so that I can populate a combobox with the values. I have my read stream etc, but I'm unsure about how I would pick out certain data from the text file that I have. The data I want is all the CD id's such as cd232 and 342, the text files structure is below. I would really appreciate your help.

CD232
Bryan Adams
Greatest Hits
HMV
UK
CD
Reading Store
CD342
Bryan Adams
18 Til I die
HMV
UK
DVD
Oxford Store


Cheers

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Acedia
0

Does the text file contain delimiters other than CRLF ?
If not, then you will have to consider using line based parsing.
Line 0 = CDid
Line 1= Artist
Etc.

If you can post some code, someone (if not me) will come along and give you some feedback.

// Jerry

0

if you encompass your cd234 with [] you can find them easier,
then when reading information to populate whatever if the first char is "[" then it's the end of the list for cd234, and stop populating.

for example your new file structure could be:

[cd234]
some data
more data
little bit more
almost there
alright done
[cd235] --- hey time to stop. first char is "["

if you need more help, just say so...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.