[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"
"Kukës","Has","Kukës","Tropojë"
"Lezhë","Kurbin","Lezhë","Mirditë"
"Shkodër","Malësi e Madhe","Pukë","Shkodër"
"Tirana","Kavajë","Tirana"
"Vlorë","Delvinë","Sarandë","Vlorë"

where thee first column contains the regions and the subsequent the districts.

what is the best way to return a file like:

"Berat","Kuçovë"
"Berat","Skrapar"
"Dibër","Bulqizë"
"Dibër","Dibër"
"Dibër","Mat"

etc...

and to write it out as a new file.

Python has a 'csv' library, which handles your kind of files.
I have never used it however, so I cannot give you more details.


Good luck,
Albert
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to