Hi there,
I think the reason might be that your locale is set to german and awk
expects a "," instead of a "." to denote the floating point number.
Try your script with a test file that uses 0,490384092 and see if it
works with that -> then you have confirmation.
My locale is set to:
[EMAIL PROTECTED]:~> locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
and your script works as is.
good luck,
Martina
Stefan Trost wrote:
> Hi,
>
> I am currently running crazy with a very simple AWK skript... but for any
> reason awk does not read any floating point variables from my trace file
>
> ----------------------------------------
> BEGIN{
> }
>
> {
> time = $3
> printf("Time: %.6g \n", $3)
> }
> END{
> }
> ---------------------------------------------
>
> The problem is, that I the script just prints the first number and ignors all
> other digits
>
> e.g. 0.499890716 --> 0
>
> I also tried printing it as a string, that works, but I cannot use it for any
> calculation...
>
> Please help!!!!!!
>
>
>
>
>
>
>
>
> ___________________________________________________________
> Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail:
> http://mail.yahoo.de