The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 01-08-2008
jaduks's Avatar
jaduks jaduks is offline
Registered User
  
 

Join Date: Aug 2007
Location: Assam,India
Posts: 167
$ paste -d "|" filex filey filez | awk '
> BEGIN{OFS=FS="|"} {print $1,$2,$4,$6,$2+$4-$6}
> ' | awk 'BEGIN{OFS=FS="|"}{ for(i=0;i<=NF;i++)
> if ( $i == "" )
> $i=0
> print $0}'


<Output>
1|100|200|300|0
2|200|200|100|300
3|300|600|200|700
4|400|800|0|1200
5|500|0|0|500