I have a huge text file in following format:
{Bunch of text
.
.
}
<tag> Text1 </tag>
{Bunch of text
.
.
}
<tag> Text2 </tag>
{Bunch of text
.
.
}
<tag> Text3 </tag>
{Bunch of text
.
.
}
<tag> Text4 </tag>
// This continues till about Text600
I want to extract Text1, Text2, Text3, Text4,..., Text600 in the output file. How can i achieve this?
/* BTW, I am not getting my homework done here. I am an ex-programmer, who has now moved to marketing for some time now, and today, I encountered this problem, which I believe can be solved easily through programming. */
Filter text enclosed in specific tags from a text file
Are you talking about getting multiple values from a single type of tag (I mean with the same name). Or was the repeated use of "<tag>" just for illustrative purposes? (Your post title does refer to tags.)
Does the text between tags only ever occupy a single line?
And how HUGE is huge??
Andy
PS Is it an actual XML file, of just text with some tags? And do you happen to know the encoding of the file?