octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: locale for scanf backed out


From: Philip Nienhuis
Subject: Re: locale for scanf backed out
Date: Tue, 26 Feb 2013 11:58:58 -0800 (PST)

Pascal,


Pascal Dupuis-4 wrote
> 2013/2/26 Rik <

> rik@

> >:
>> 2/25/13
>>
>> All,
>>
>> I backed out the locale changeset for scanf.  Unfortunately, due to
>> issues
>> in the build system you will need to manually remove
>> libinterp/interpfcn/file-io.cc-tst before tests will pass.
>>
>> --Rik
> 
> Rik,
> 
> I find this a bit unfair. There was an agreement that supporting
> locale on printf is not a good idea; nor implement something like
> National Instruments extension to force the use of a decimal point.
> 
> OTOH, I can assure you that changing the locales used in a CSV file is
> everything but easy. CSV files contains strings and numbers intermixed
> by separators. What about separators and points and comma inside
> strings ? What about string delimiter inside string like 'O''Reilly' ?
> Some broken programs even quote every number !

Have you tried the csv2cell() function in the io package? 
At least it allows to change the field separator and string protection
character, perhaps that is a step in the right direction for you. 
I have used it for csv files in Dutch locale (nl_NL; also with ',' a decimal
separator); the field separator turns into a ';' for that locale and '"'
(double quote) remains (default) string protection character. Easily
processed by csv2cell().
Afterwards some strrep processing is needed on numeric data columns to
change ',' into '.' (optionally first remove '.' thousands separators).

Philip




--
View this message in context: 
http://octave.1599824.n4.nabble.com/locale-for-scanf-backed-out-tp4650293p4650310.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]