![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| POSIX way of getting columns in tty? | otheus | Shell Programming and Scripting | 13 | 01-12-2009 10:31 AM |
| text in columns | mierdatuti | Shell Programming and Scripting | 4 | 01-10-2009 08:38 AM |
| Row to Columns | vskr72 | UNIX for Dummies Questions & Answers | 4 | 03-21-2007 09:53 AM |
| add columns with awk | tonet | Shell Programming and Scripting | 4 | 06-21-2005 04:02 AM |
| printing columns | cdunavent | Shell Programming and Scripting | 3 | 06-07-2003 12:31 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Addition of the values. Sorry not substraction this time
Thanq u
but my file is little bit complicated. all values of column 1 and 2 are in 2 seperate single cells!!!!!! input column1 0,9607,12887,24088, column2 579,248,404,385 output 579,9855,13291,24473 |
|
|||||
|
Hmmm...Could you post sample input and output?
I got the ff: Code:
$ cat foo
0,9607,12887,24088,
579,248,404,385
$ awk 'BEGIN {FS=","} { for (i=1;i<=NF;i++) sum[i]=sum[i] + $i } END { for (i=1;i<=NF;i++) printf("%d,", sum[i]) }' foo
579,9855,13291,24473,
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|