![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
awk help
Hi
In my file there are 4 columns having amount fields,but I am getting different amounts using the below one's awk -F "|" '{a+=$1+$2+$3+$4} END {printf ("%f\n",a)}' file 1123337200682.226562 awk 'BEGIN{FS=OFS="|"} {for(i=1;i<=NF;i++) {a+=$i;n++ }} END {printf ("%f\n",a)}' file 1123337200684.453613 Thanks, MR |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|