Home > Archive > AWK > July 2004 > Decimal Point in gawk
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Decimal Point in gawk
|
|
| Berend Hasselman 2004-07-28, 3:56 pm |
|
I am running Gawk 3.1.3 under Windows 2000 (Dutch version).
I have a lot of generated output containing decimal numbers with decimal
dots (1,234). I cannot change the output.
The decimal separator in the Dutch version of Win2000 is ,
The internationalised gawk doesn't recognise 1.234 as a decimal number.
It also outputs any floating point numbers with a decimal ,
I don't want to change the Windows decimal separator.
I have tried
set LC_ALL=C
but this doesn't seem to work.
I would like gawk to recognise 1.234 as number and to output a decimal .
instead of the decimal ,
How can I tell gawk 3.1.3 to use decimal dots on both input and output?
(BTW I have looked in the archive for comp.lang.awk at Google but
couldn't find what I wanted)
Berend Hasselman
| |
| Stepan Kasal 2004-07-29, 8:55 am |
| Hello,
Berend Hasselman wrote:
> The decimal separator in the Dutch version of Win2000 is ,
....
> I have tried
> set LC_ALL=C
I suppose you haven't made any mistake, so you started a command.com
in a window, then you typed set LC_ALL=C and on the next line you
typed the gawk command. Is that right?
Well, if this guess didn't help, you have to find out which Windows
port do you use: cygwin? djgpp? gnuwin32?
Then, you have better chances getting help from the people working on
that port, even though they don't use gawk.
As an experiment, you might try to get a fresh new install of cygwin
(over internet), then opening the Cygwin bash window, then
export LC_ALL=C
and then try running gawk (from that command-line).
If this works, try to eliminate where the problem was.
HTH,
Stepan
| |
| Berend Hasselman 2004-07-29, 3:55 pm |
| Hi
Stepan Kasal wrote:
> Hello,
>
> Berend Hasselman wrote:
>
>
> ...
>
>
>
> I suppose you haven't made any mistake, so you started a command.com
> in a window, then you typed set LC_ALL=C and on the next line you
> typed the gawk command. Is that right?
>
Yes
> Well, if this guess didn't help, you have to find out which Windows
> port do you use: cygwin? djgpp? gnuwin32?
>
Gnuwin32
> Then, you have better chances getting help from the people working on
> that port, even though they don't use gawk.
>
> As an experiment, you might try to get a fresh new install of cygwin
> (over internet), then opening the Cygwin bash window, then
>
> export LC_ALL=C
>
> and then try running gawk (from that command-line).
>
I specifically want to use the Gnuwin32 stuff.
You don't need additional libraries and the like.
> If this works, try to eliminate where the problem was.
>
> HTH,
> Stepan
I have had a personal reply from the maintainer of gawk and the
suspicion is that something very funny/nasty is going on.
set LC_ALL=C apparently ought to work.
| |
| Stepan Kasal 2004-07-30, 8:55 am |
| Hello,
Berend Hasselman wrote:
> I specifically want to use the Gnuwin32 stuff.
> You don't need additional libraries and the like.
well, with cygwin, distributing one DLL should be enough.
And, IIRC, you can place it in the same dir as the executable.
Perhaps this is worth trying.
> I have had a personal reply from the maintainer of gawk and the
> suspicion is that something very funny/nasty is going on.
> set LC_ALL=C apparently ought to work.
You mean Gnuwin32 port gawk maintainer?
I looks like the problem is in the underlying library emulating standard
Unix environment, so the port main maintainer is the person to ask.
You could also try djgpp from www.delorie.com their gawk package isn't
at 3.1.3, I'm afraid (3.1.1, IIRC), but the binary is standalone.
In fact it's a DOS binary with 32-bit extender, but I think it can
understand Windows long filenames.
In any of these environments, if you have the environment fully set up,
so you can recompile gawk, you can use
./configure --disable-nls
That should disable all national language support.
In Unix, this means "C" locale hardwired, but in buggy Win port, this can
mean you have the default Windows locale. So you might also try
recompiling with --enable-nls, and this might help.
A good trick to find out whether the gawk is compiled with or without locale
support is to search gawk.exe fro "LC_NUMERIC" or "LC_".
(To be more exact: take any other binary from the same port, see cat.exe,
verify that it contains no "LC_". If it's true, that port doesn't add this,
so you can use this chekc on gawk.exe.)
Hope some of these hints helps,
Stepan Kasal
|
|
|
|
|