[GRASSLIST:6666] Overriding awk locales

Jose Gomez-Dans jgomezdans at gmail.com
Thu Apr 28 12:02:17 EDT 2005


Hi!
This is not a GRASS-specific question, but it crops up in GRASS use,
and I don't know how to solve it. I want to use v.in.ascii to load
some points. These points are in a file, and I have used awk '{printf
"%16.6f|%16.6f|%16.6f\n", $1,$2,$3}' to generate my files. However,
due to the locale that I have, the numbers have a comma "," as a
separator for decimals, and GRASS expects a dot ".".  (sorry for the
artistic punctuation :D).

I can do several things: change the locale to C, change the locale for
awk only (or make awk override any locale values it finds), or GRASS
should be able to work out that I'm using another locale with a
different number representation. Up to now, I use sed to change the
commas into dots, and seems to be working, but I thought I'd mention
it, in case the locale issue is in fact a GRASS bug.

Jose




More information about the grass-user mailing list