reading a specific column from file

Ivan Novick ivan at
Fri Jan 11 18:46:29 CET 2008

On Jan 11, 4:15 am, cesco <fd.calabr... at> wrote:
> Hi,
> I have a file containing four columns of data separated by tabs (\t)
> and I'd like to read a specific column from it (say the third). Is
> there any simple way to do this in Python?

You say you would like to "read" a specific column.  I wonder if you
meant read all the data and then just seperate out the 3rd column or
if you really mean only do disk IO for the 3rd column of data and
thereby making your read faster.  The second seems more interesting
but much harder and I wonder if any one has any ideas.  As for the
just filtering out the third column, you have been given many
suggestions already.

Ivan Novick

More information about the Python-list mailing list