Thread

Posted on Wed May 30 10:53:35 2007 by claregj
xls2csv How can I change separator to semicolon?
Hi folks, Very new at this but it works beautifully. Some of my input fields have commas. I could change them in excel, but it is much harder to persuade other people to remember to do it. Help will be much appreciated. clare
Direct Responses: 5268 | Write a response
Posted on Wed May 30 14:40:49 2007 by jochenhayek in response to 5267
Re: xls2csv How can I change separator to semicolon?
Can you see this line in the code:
print CSV join(',', @row), "\n";
Change ',' to ';', if you really want the semicolon. The "if" statement above actually attempts to protect the embedded commas and double-quote characters, and you would have have to swap the comma there with a semicolon as well. And the "open" function call further above does not deal with UTF8 Excel files, so I changed it to look like this:
open(CSV , '>:utf8' , "$prefix-Sheet$index.csv");
Write a response