Extracting Text file contents using Python

jam jam at newimage.com
Mon Jun 28 08:46:36 EDT 1999


On Mon, Jun 28, 1999 at 07:37:50PM +0800, john wrote:
> 
> Hi,
> 
> I am trying to extract the following text file using python and the program
> & text file are as shown below.
> 
> But unfortunately I am unable to get every separate data displayed except
> for the first data and after the separation line which is
> "====================" the next data is not getting picked up by the
> program.
> Could anyone kindly let me know what could be wrong with the program.
> 
> Example Text File - But will be similar
> ----------------------------------------------------
[..snipped..]
> 
> The python program is as follows:
> 
[..snipped..]

I didn't have any trouble with this code on my linux machine. 

the one thing that might be confusing the issue is that all of your records
are identical.. one thing I did while testing your code was to change the
'rating' field to a unique number (only 8 records, so I changed each to have
a number in that sequence).. then you can see the data changing, and it's
much clearer whether or not it's working.

give that a shot, and see what happens.

regards,
J

-- 
|| visit gfd <http://quark.newimage.com/> 
|| psa member #293 <http://www.python.org/> 
|| New Image Systems & Services, Inc. <http://www.newimage.com/>




More information about the Python-list mailing list