![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help please...output problems with printf. | pwanda | UNIX for Advanced & Expert Users | 3 | 10-19-2008 08:30 PM |
| awk printf formatting using string format specifier. | kanu_pathak | Shell Programming and Scripting | 9 | 08-25-2008 08:51 PM |
| How do I stop printf output from going into seperate txt files | chrchcol | Shell Programming and Scripting | 12 | 07-26-2006 10:08 PM |
| printf format | laila63 | Shell Programming and Scripting | 3 | 07-16-2004 01:29 PM |
| fixed-width printf() output on an XmList on Solaris | trido | High Level Programming | 0 | 11-20-2002 05:21 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi
I'm using awk to manipulate the data in the 6th field of the file xxx_yyy.hrv. The sample data that is available in this field is given below 220731.7100000000000000 When i tried using this command cat xxx_yyy.hrv | awk '{printf("%23.16f\n",$6*-1)}' I get the output as -220731.7099999999991269 but i need the output as -220731.7100000000000000 Plz let me know on the format that i should be using to retreive the desired output. Thanks!!! |
|
||||
|
Hi vgersh99!!!
I tried with command that you've given awk '{printf("%23.16f\n", sprintf("%.2f", $6-1))}' xxx_yyy.hrv | head -5 | tail -1 but i get the output as 220730.7099999999991269 but i need the output to be -220731.7100000000000000 My requirement is to multiply the 6th field value with -1, and my pbm is the value after the decimal point gets modified when it is multiplied. Plz let me know for any other possibilities also. Thanks!!! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|