[Tutor] extracting a column from many files

susana moreno colomer susana_87 at hotmail.com
Thu Jul 12 17:45:31 CEST 2012


Hi!
 
I have a group of files in a directory:
bb_1.txt
bb_2.txt
bb_3.txt
bb_4.txt
bb_5.txt
bb_6.txt
ss_1.txt

I want to extract from  files whose names start with  bb_   column number 5 and 6. I want to extract all columns number 5 to one file, and all tcolumns number6 to another file. 
I was following this example http://mail.python.org/pipermail/tutor/2009-February/067400.html , and I created my own code wich gives me the following errors:
 

This code gives me 2 files:
                ro with 2 lines
                bf emty
 
I attached my code, with two options (though I was trying wich much more)
Could be awesome If I extrace them in an excel file, Any suggestion????
 
Many thanks!!!
Susana 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120712/985b56d1/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: multifiles.txt
URL: <http://mail.python.org/pipermail/tutor/attachments/20120712/985b56d1/attachment.txt>


More information about the Tutor mailing list