Hi,
Thank you for the fast help and explanation. I gonna try the set option!
I'm using the zip version x86 on windows 7 x64.
Have a nice Sunday
Leon
Am 14.06.2014 um 23:16 schrieb Allin Cottrell
<cottrell(a)wfu.edu>:
> On Sat, 14 Jun 2014, Pindar wrote:
>
> I programmed a function that uses getline and sscanf to parse
> several internet time series from a string at ones.
>
> To do so I replace the comma in decimal characters with a dot.
> This is working when gretl is set on English. If I now turn to
> German because I need the csv output option (which is
> unfortunately only present when set to German) then the doubles
> are either made to integers or when using commas no import happens
> at all.
There is a bug here (more below) but the short answer is: use
set force_decpoint on
and then gretl in German will behave in the same way as gretl in
English with regard to sscanf. In addition, if you really, really
want to output a "csv" file with decimal commas when running gretl
in English (something that is not at all recommended, and therefore
is not made easy), consider this example:
<hansl>
open data4-1
set csv_delim semicolon
store horrid.csv
string s = readfile("horrid.csv")
s = strsub(s, ".", ",")
outfile horrid.csv --write
printf "%s", s
outfile --close
</hansl>
OK, here's the bug mentioned above. What happens if you trying using
sscanf on numerical values that use the decimal comma, when running
gretl in German (or any locale that uses the decimal comma), without
doing "set force_decpoint on"? You might expect that either (a)
you'd get the same effect as when running in English (truncation to
integer) or else (b) you'd get the full numerical value. But up till
now you'd in fact get an error condition. Bug!
For the present I've "fixed" this (in CVS) such that you get the
full numerical value, but I'm not at all sure that's right. That
needs further discussion.
Allin
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users