in reply to Parsing CSV table
>That message indicates that you are using a very old Spreadsheet::Read, as ReadData () accepts (multiple) options since at least 2007 (that is how far my git repo goes back).
I started using Spreadsheet modules 3 or 4 months ago so they can't be old. I even performed upgrade Spreadsheet-Read within ppm and it returned Spreadsheet-Read 0.03: up to date..
Since the module refuses to accept sep parameter (semicolon as separator) I decided to write something by myself. At first I used the Data::Dumper to check what characters I read at all: it reported that characters mentioned below don't map to CP1250. I open a CSV file and use regex to perform replacements: every non-cp1250 character is replaced with unicode character. When I write data into a XLS file using Spreadsheet::WriteExcel the national characters are written correctly.
... open($fh,"Table.csv"); @Table=<$fh>; close($fh); foreach $Table(@Table){ $Table=~s/\x{00c8}/\x{010c}/g; # capital C with caron $Table=~s/\x{008a}/\x{0160}/g; # capital S with caron $Table=~s/\x{008e}/\x{017e}/g; # capital Z with caron $Table=~s/\x{008a}/\x{010d}/g; # small c with caron $Table=~s/\x{00e8}/\x{0161}/g; # small s with caron $Table=~s/\x{00e8}/\x{017f}/g; # small z with caron # follows the code parsing semicolons } # writing data into XLS file
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing <span style=
by Tux (Canon) on Sep 09, 2010 at 06:16 UTC | |
|
Re^2: Parsing CSV table
by Anonymous Monk on Sep 09, 2010 at 06:40 UTC |