Filtering content of a text file

Ira.Kovac at Ira.Kovac at
Fri Jul 27 11:28:27 CEST 2007

Hello All,

I'd greatly appreciate if you can take a look at the task I need help

It'd be outstanding if someone can provide some sample Python code.

Thanks a lot,



I am working with 30K+ record datasets in flat file format (.txt) that
look like this:

//-+alibaba sinage
//-+amra damian//_9
//-+anix anire//_
//-+bokima sun drane
//-+cop calestieon eded
//-+drago kimano sole

The records start with the same string (in the example //-+) wich is
followed by another string of characters taht's changing from record
to record.

I am working on one file at the time and for each file I need to be
able to do the following:

a) By looping thru the file the program should isolate all records
that have letter a following the //-+
b) The isolated dataset will contain only records that start with //-
c) Save the isolated dataset as flat flat text file named a.txt
d) Repeat a), b) and c) for all letters of english alphabet (a thru z)
and numerical values (0 thru 9)

CP: An inch of time is an inch of gold but you can't buy that inch of
time with an inch of gold.

Random Link Generator

More information about the Python-list mailing list