Reading from input file.

paczkow at gmail.com paczkow at gmail.com
Tue Jan 10 19:31:40 EST 2006


Dear Python Community,

I am an engineering and I am experiencing some trouble. Having output
data from other software I want to use it. To achieve this I decided to
use Python since this language is the best known for me.

So.. for my future Python script, the input data are in form of:
1
1233.2E-3     2123.2323 2E+2   3453.3E+1
1233.2E-3     2123.2323 2E+2   3453.3E+1
1233.2E-3     2123.2323 2E+2   3453.3E+1
2
1233.2E-3     2123.2323 2E+2   3453.3E+1
1233.2E-3     2123.2323 2E+2   3453.3E+1
1233.2E-3     2123.2323 2E+2   3453.3E+1
and so on...

The number 1 and 2 and so on, are the numbers of measurments, which are
different in number depending on analyzed case. So sometimes it could
be 3 and sometimes 1000 or more.

What I want to achieve, I want to compare or rather get difference
between two similar input files. I tried to work with "readline"
command, however it is hard to use it (for me) since input files are
different in its size (3,1000 or more input points). Therefore, I
decided to ask you for help how to do it. Esspecially how to make that
python script which  will be reading data, each line, and each column
of input file and therefore will compare it with different input file
giving finally difference size between each measures for example:
First data at point 1 minus first data from point 1 from different
input file:
(1233.2E-3) - (1233.3E-3) = -0.1E-3

Looking forward for you answer,

Best regards,

Krystian




More information about the Python-list mailing list