Ronald Wiplinger said on 25/10/02 17:16:
I have a text file which looks basically so:
record-number,"aaaaa","title text","description text",flag-1,flag-2,"additional text"
Well .. there are a number of ways you could do it, but I always use Perl for this kind of thing. Without seeing your actual file(s) it's not possible to give you a precise solution, but if I understand you correctly you have one file with 6000 similar stanzas in it .. so .. please see attached Perl script. Supply the filename as a command line argument .. perl regex.pl filename This is just a quick hack .. but maybe it's enough to get you started? I couldn't see where your additional text came from, BTW. And the script won't handle newlines in the bits you want to extract ... and other stuff ;-) If you get stuck, feel free to send me the file (so long as it is ONE file, and not 6000) with an example record clearly marking the bits you need to get out, and I'll write you a proper script. sjb p.s. If the attachemnt gets stripped off, download it from http://www.ottaky.com/regex.perl