On Wed, Nov 25, 2009 at 1:38 AM, Christian Witts <[email protected]> wrote:
> If your output is going to be sorted like that so you know NONAME will be on
> the same line in both files what you can do is
>
> INCT = open('something.csv', 'r')
> INMRI = open('something_else.csv', 'r')
>
> rec_INCT = INCT.readline()
> rec_INMRI = INMRI.readline()
>
> while rec_INCT and rec_INMRI:
> name, x, y, z, a, b, c, d = rec_INCT.split(',')
> NAME, X, Y, Z, A, B, C, D = rec.INMRI.split(',')
>
> if name == NAME:
> print 'Matches'
>
> rec_INCT = INCT.readline()
> rec_INMRI = INMRI.readline()
>
> INCT.close()
> INMRI.close()
For this to work the files must have the same names in the same order.
It's not enough that they be sorted, they have to have the same
entries.
Kent
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor