Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- How to read fields from a file?
- Kurda Yon
September 30, 2008, 11:47 pm
rate this thread
I have a file with data written in a "matrix" form. In other words,
every row contains a fixed number of fields and I am interested in the
value of each field of every row.
I managed to read rows in the following way:
f = open('filename.dat','r')
for line in f:
x = line
However, I cannot find out how to split every line into fields? What
should I do if I, let's say, need a value which is located in the
third row in the second column (field).
October 1, 2008, 9:07 am