Dec 2, 2011, 8:55 AM
Post #1 of 1
[Linux] Perl 5.12.3 -- parsing issue
This is a long time I've been on the forum to request enlightments concerning the use of Perl.
I'm writing a little script to parse .csv files in order to insert some parsed datas in a database.
Problem is that I encounter issue with the split function that won't split ^^
Unfortunately I'm frenchspeaking and I have accentuated characters in my parsed datas and I need to find a way to split it correctly.
When I try
The result is all but the expected, the string "Période:" is inserted in the wrong side of the split ^^
I tried with
It worked but I was forced to do three chops in a raw to delete the 'P', the 'é' and the newline character...
The character set of the .csv file is utf8 and I never found documentation concerning the fact that split() won't work with accentuated characters...
Is someone have an idea of how I could split the line from the file I'm reading correctly ?
I tried with regular expressions, but I'm not easy with and P.riode doesn't work, P*riode doesn't work and P.*riode won't meet my expectations too...
Thanks in advance !!