[Tutor] get columns from txt file

Don Jennings dfjennings at gmail.com
Wed Jul 11 16:59:39 CEST 2012


On Jul 11, 2012, at 10:21 AM, tutor-request at python.org wrote:
> 
> Message: 4
> Date: Wed, 11 Jul 2012 16:20:05 +0200
> From: susana moreno colomer <susana_87 at hotmail.com>
> To: <tutor at python.org>
> Subject: [Tutor] get columns from txt file
> Message-ID: <BAY164-W2886BE3C3D5A8B0E3D496384D10 at phx.gbl>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> 
> Hi!
> 
> I have a group of files in a directory.
> I want to extract from  files whose names start with  bb_   column number 5 to an excel file. I have 6  bb_  files, therefore I want to get 6 columns (5th column from each file)
> This code is working,with the following errors:
> 
> I get the data in only one column, instead of six
> I get white cell after every extracted cell
> 
> I've got  help from http://mail.python.org/pipermail/tutor/2004-November/033474.html, though it is not working for me


If I understand your requirements correctly, you should read the followup message in that thread:

http://mail.python.org/pipermail/tutor/2004-November/033475.html

Primarily, you'll just have to alter one of the code samples to write it to csv.

Take care,
Don

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120711/49043c14/attachment.html>


More information about the Tutor mailing list