Organize large DNA txt files

andrew cooke andrew at acooke.org
Sat Mar 21 15:57:06 EDT 2009


a faster and simpler solution, assuming you are on unix, is to just use
the sort command:

spl6 tmp: cat 1-
1        74        0        0        6        0
1        78        0        0        4        0
1        89        0        0        0        2
spl6 tmp: cat 1+
1        73        0        1        0        0
1        76        1        0        0        0
1        77        0        1        0        0
spl6 tmp: sort -n -k 2,2 1[-+]
1        73        0        1        0        0
1        74        0        0        6        0
1        76        1        0        0        0
1        77        0        1        0        0
1        78        0        0        4        0
1        89        0        0        0        2

bash can also iterate over files trivially.  you do not need python for this.

andrew





More information about the Python-list mailing list