shell-script-pt
[Top][All Lists]
Advanced

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

awk e soma com ponto flutuante


From: address@hidden
Subject: awk e soma com ponto flutuante
Date: Mon, 25 Jun 2007 10:38:12 -0300
User-agent: Thunderbird 2.0.0.0 (X11/20070326)

Olá pessoal,

Tenho uma tabela com números em ponto flutuante na coluna 4. Necessito
somar estes números e para isto tentei com o awk

cat arquivo | awk '{ if (NR>1) SOMA+=$4 } END { print SOMA }'

A soma deve ser feita a partir da segunda linha. O problema é que o SOMA
é um inteiro. Tem alguma forma de fazer isto com o awk?

Até
Alves


reply via email to

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