[Tutor] how to select a column from all files in one directory?

kumar s ps_python at yahoo.com
Tue Nov 23 14:37:58 CET 2004


Dear group, 
 I have ~40 tab-delimitted text files in one
directory. I have to select 4th column from all these
files and write it into a single tab delimitted text
file. How can I do this in python.

I read a prev. post on tutor and tried the following:

>>files = listdir('path')

This returns the files(file names) in the directory as
a list. However, I need the 4th column from all the
files in the directory. 

Can you please help me. 

Thank you. 

-kumar 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Tutor mailing list