[Tutor] csv manipulation OOPS

bob gailer bgailer at gmail.com
Wed Oct 29 17:11:45 CET 2008


I goofed - overrode input. So I changed my filenames
> [snip]
> inputFile = open(path-to-the-input-file, 'r')
> outputFile = open(path-to-the-output-file, 'w')
>
> for line in inputFile :
>  line = line.split(",") # ["Berat", "Berat", "Kuçovë", "Skrapar"]
>  region = line [0]
>  for district in line[1:]:
>    outputFile .write(region + "," + district + "\n")
> inputFile .close()
> outputFile .close()
>


-- 
Bob Gailer
Chapel Hill NC 
919-636-4239

When we take the time to be aware of our feelings and 
needs we have more satisfying interatctions with others.

Nonviolent Communication provides tools for this awareness.

As a coach and trainer I can assist you in learning this process.

What is YOUR biggest relationship challenge?



More information about the Tutor mailing list