Hey everyone,
I spent a day trying to adapt Mr. Gailer's simple and elegant code to the
csv version suggested by Mr. Johnson, but I can't seem to get it working.
I adapted the example to my particular use case, but the problem occurs
regardless of the dataset used: Namely, when I loop through
sorry -- forgot to complete my thought in 2nd graf. see below...
On Fri, Oct 31, 2008 at 9:29 AM, Serdar Tumgoren [EMAIL PROTECTED]wrote:
Hey everyone,
I spent a day trying to adapt Mr. Gailer's simple and elegant code to the
csv version suggested by Mr. Johnson, but I can't seem to get it
On Fri, Oct 31, 2008 at 9:32 AM, Serdar Tumgoren [EMAIL PROTECTED] wrote:
Below is my code. Can someone tell me how I'm botching the use of the
writerows method? Also, on a separate note, is it possible and necessary
to close the input and output files when using csv module? I keep getting a
Aha! That did the trick. Thanks so much!
On Fri, Oct 31, 2008 at 10:02 AM, Kent Johnson [EMAIL PROTECTED] wrote:
On Fri, Oct 31, 2008 at 9:32 AM, Serdar Tumgoren [EMAIL PROTECTED]
wrote:
Below is my code. Can someone tell me how I'm botching the use of the
writerows method? Also, on a
hello,
i have the follwoing csv file:
Berat,Berat,Kuçovë,Skrapar
Dibër,Bulqizë,Dibër,Mat
Durrës,Durrës,Krujë
Elbasan,Elbasan,Gramsh,Librazhd,Peqin
Fier,Fier,Lushnjë,Mallakastër
Gjirokastër,Gjirokastër,Përmet,Tepelenë
Korçë,Devoll,Kolonjë,Korçë,Pogradec
Kukës,Has,Kukës,Tropojë
[EMAIL PROTECTED] wrote:
hello,
i have the follwoing csv file:
Berat,Berat,Kuçovë,Skrapar
Dibër,Bulqizë,Dibër,Mat
Durrës,Durrës,Krujë
Elbasan,Elbasan,Gramsh,Librazhd,Peqin
Fier,Fier,Lushnjë,Mallakastër
Gjirokastër,Gjirokastër,Përmet,Tepelenë
Korçë,Devoll,Kolonjë,Korçë,Pogradec
[EMAIL PROTECTED] wrote:
hello,
i have the follwoing csv file:
Berat,Berat,Kuçovë,Skrapar
Dibër,Bulqizë,Dibër,Mat
Durrës,Durrës,Krujë
Elbasan,Elbasan,Gramsh,Librazhd,Peqin
Fier,Fier,Lushnjë,Mallakastër
Gjirokastër,Gjirokastër,Përmet,Tepelenë
Korçë,Devoll,Kolonjë,Korçë,Pogradec
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
On Wed, Oct 29, 2008 at 11:28 AM, bob gailer [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
hello,
i have the follwoing csv file:
Berat,Berat,Kuçovë,Skrapar
There is a csv module, but for something this simple the following will
suffice:
as long as none of the data fields include a