![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| bash. convert mpeg adts to normal mp3 | stahoo23 | Shell Programming and Scripting | 5 | 05-18-2008 02:26 AM |
| Distribution Release: Scientific Linux 5.1 | iBot | UNIX and Linux RSS News | 0 | 01-16-2008 04:10 PM |
| How to add/multiply numbers with scientific notation (2.343e-5) | chugger06 | UNIX for Dummies Questions & Answers | 1 | 01-26-2006 06:03 PM |
| how to convert from korn shell to normal shell with this code? | forevercalz | Shell Programming and Scripting | 21 | 11-22-2005 10:18 PM |
| Easy UNIX notation question | lavaghman | UNIX for Dummies Questions & Answers | 1 | 06-05-2002 12:20 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hell friends,
I wrote a script gets the summation of particular column using awk. The awk output is given in scientific notation. How do I convert the scientific notation to normal. My awk syntax : awk '{sum += $2} END { printf sum }' temprep.txt Out put is like 1.5365e+07 I want it as 15365000 Please give me a suggestion. Thanks Mahesh |
| Forum Sponsor | ||
|
|
|
|||
|
When I check man awk in Solaris it says there is a built in variable called OFMT that controls the output format of numbers. You could try setting that to a different format. Also, it says after the printf you can specify the format, check man printf for details on that. I would guess printf %8d sum would work for your example.
|