Re: splitting file/content into lines based on regex termination

2013-11-09 Thread Piet van Oostrum
bruce writes: > hi. > > thanks for the reply. > > tried what you suggested. what I see now, is that I print out the > lines, but not the regex data at all. my initial try, gave me the > line, and then the next items , followed by the next line, etc... exp = re.compile(r"(#\d+\s*/\s*\d+#\d+#)")

Re: splitting file/content into lines based on regex termination

2013-11-07 Thread bruce
hi. thanks for the reply. tried what you suggested. what I see now, is that I print out the lines, but not the regex data at all. my initial try, gave me the line, and then the next items , followed by the next line, etc... what I then tried, was to do a capture/findall of the regex, and combine

Re: splitting file/content into lines based on regex termination

2013-11-07 Thread MRAB
On 07/11/2013 17:45, bruce wrote: update... dat=re.compile("#(\d+) / (\d+)#(\d+)#").split(s) almost works.. except i get m = 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett, William#3#MWF#08:00am#08:50am#3718 HBLL m = 45 m = 58 m = 0 m = 10116#000#C S#S#100##002##DAY#Fund of Computi

Re: splitting file/content into lines based on regex termination

2013-11-07 Thread bruce
update... dat=re.compile("#(\d+) / (\d+)#(\d+)#").split(s) almost works.. except i get m = 10116#000#C S#S#100##001##DAY#Fund of Computing#Barrett, William#3#MWF#08:00am#08:50am#3718 HBLL m = 45 m = 58 m = 0 m = 10116#000#C S#S#100##002##DAY#Fund of Computing#Barrett, William#3#MWF#09:00am#09: