Array column separations for beginners

Rhodri James rhodri at kynesim.co.uk
Wed Apr 26 10:25:57 EDT 2017


On 26/04/17 15:04, katarin.bern at gmail.com wrote:
> Hi,
> 1. I would like to ask how can I adjust array.csv like this:
> ,,,-00.000146400000,   0.08000,
> ,,,-00.000146200000,   0.00000,
> ,,,-00.000146000000,   0.00000,
> ,,,-00.000145800000,   0.00000,
>
> so I can have in first column -00.000146400000 and in second column 0.08000? (thanks, I am begginer).

Use the csv module in the standard library.  Here's some pseudocode to 
help you on your way:

Open array.csv to read
Create a csv.reader for it
Open new file (say, out.csv) to write
Create a csv.writer for it
for each line in the reader:
   write the columns you want through the writer


> 2. How can I pick out information(number) from 20 separate files to one file? (thanks!)

Without a more detailed description it's difficult to be very helpful. 
Basically you read the information from each input file separately and 
write it to your output file.

-- 
Rhodri James *-* Kynesim Ltd


More information about the Python-list mailing list