The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-25-2008
paresh n doshi paresh n doshi is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 38
totalling in awk script

> using awk (on SCO Unix) i tried to take a summary of a datafile


> the code used is:
> awk '
> FILENAME == "FLN" {balance[substr($0,14,3)] += substr($0,17,13) {
> END {for ( name in balance ) printf("%013s %3s of %8s\n",
> balance[name]/100,name,dt) | "sort" } ' fln
>
>
> THE result i get is not proper. Where the amounts are large,
> it displays total in some odd fashion.
>
> Can u please see where I am making mistake.

where the amounts are not large it is giving correct result
only where amounts are large it errs
>
> Doshi
>