Simple Text Parsing.. Long Time Since College
Hello all,
I was hoping someone wouldn't mind pointing me in the right direction. It's been a long while since my last C programming class in college ;)
I'm looking to parse a text file.
Looking like this:
yellow 111111
yellow 222222
yellow 333333
blue 111112
blue 111113
green 222221
green 222223
green 222224
green 222225
or this:
111111 yellow
222222 yellow
333333 yellow
111112 blue
111113 blue
222221 green
222223 green
222224 green
222225 green
basically what i need is to embed the numbers in the colors with open and close tags. the output should look like:
#opencolor#yellow
#number#111111
#number#222222
#number#333333
#closecolor#yellow
#opencolor#blue
#number#111112
#number#111113
#closecolor#blue
#opencolor#green
#number#222221
#number#222223
#number#222224
#number#222225
#closecolor#green
i'm just hoping someone can point me in a direction to start, or a suggestion on how to go about this.
any help is appreciated.
thanks in advance.