JackVanRamars has asked for the wisdom of the Perl Monks concerning the following question:
Hey,
In regional settings all this country uses semicolon instead comma as CSV separator so I need to replace default comma separator with semicolon. I use Spreadsheet::Read module.
#!/usr/bin/perl use strict; use Pod::Usage; use Getopt::Std; use Spreadsheet::Read; use Spreadsheet::WriteExcel; my $ref = ReadData ("test.csv");
While this works for any XLS file I have problems with CSV files. The $ref variable remains empty. I even added use Text::CSV_XS (or Text::CSV_PP) but $ref remained empty.
Then I modified the last line:
my $ref = ReadData ("test.csv", sep => ';');or
my $ref = ReadData ("test.csv", sep => ';',quote => '"');Before I type the last line debugger reports the following error (in the line with one or both arguments):
Too many arguments for Spreadsheet::Read::ReadData
The CSV parsing module theoretically should detect separator - but it doesn't. I'm out of ideas.
Thanks in advance for your help!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing CSV table
by Tux (Canon) on Sep 06, 2010 at 13:31 UTC | |
|
Re: Parsing CSV table
by roboticus (Chancellor) on Sep 06, 2010 at 13:16 UTC | |
|
Re: Parsing CSV table
by Khen1950fx (Canon) on Sep 07, 2010 at 04:08 UTC | |
|
Re: Parsing CSV table
by JackVanRamars (Novice) on Sep 09, 2010 at 04:46 UTC | |
by Tux (Canon) on Sep 09, 2010 at 06:16 UTC | |
by Anonymous Monk on Sep 09, 2010 at 06:40 UTC |