Re: Parsing file and regexp

2010-02-19 Thread olivier.scalb...@algosyn.com
Uri Guttman wrote: > > please show your code. there is no way to help otherwise. s/// is not a > > pattern matcher but a substitution operator. it uses regexes and can be > > used to parse things. > > > > uri > > Here it is ... $ cat test.txt keyword1 word1, word2 word3; blabla blabla ke

Re: Parsing file and regexp

2010-02-19 Thread olivier.scalb...@algosyn.com
(Sorry but I have problem with my ISP, so I repost !) Uri Guttman wrote: > > how do you know when a keyword section begins or ends? how large is this > > file? could free text have keywords? i see a ; to end a word list but > > that isn't enough to properly parse this if you have 'free text'. > >

Parsing file and regexp

2010-02-13 Thread olivier.scalb...@algosyn.com
Hello, I need to extract info from some text files. And I want to do it with Perl ! The file I need to parse has the following layout: keywordA word1, word2, word3; Here we can have some free text ... ... keywordB word4, word5, word6, word7, word8, word9, word10