[Tutor] List processing

Alan G alan.gauld at freenet.co.uk
Thu Jun 2 07:17:30 CEST 2005

> I have a load of files I need to process. Each line of a file looks
> something like this:
> eYAL001C1 Spar 81 3419 4518 4519 2 1
> So basically its a table, separated with tabs. What I need to do is
make a
> new file where all the entries in the table are those where the
values in
> columns 1 and 5 were present as a pair more than once in the
original file.

My immediate answer would be to use awk.

However if that's not possible or desirable then look at the fileinput
module and the string.split function.

Alan G

More information about the Tutor mailing list