User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 374,162 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,358 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 487 | Replies: 3
Reply
Join Date: Apr 2008
Posts: 2
Reputation: manuswami is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
manuswami manuswami is offline Offline
Newbie Poster

Simple awk help

  #1  
May 2nd, 2008
Hi,

I have this belowmentioned file:

col1 col2
10 50
20 60
30 70
40 80

I have to take the O/P as

col1 col2 col3
10 50 60
20 60 80
30 70 100
40 80 120

Using awk how can i get the above output as the col3 is the sum of col1 and col2.

Thanks in advance.
Mike
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2005
Posts: 3,043
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 19
Solved Threads: 344
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: Simple awk help

  #2  
May 2nd, 2008
Yes, trivial, what have you tried for yourself ?

Read this - http://www.daniweb.com/forums/announcement113-2.html
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Reply With Quote  
Join Date: Apr 2008
Posts: 2
Reputation: manuswami is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
manuswami manuswami is offline Offline
Newbie Poster

Re: Simple awk help

  #3  
May 4th, 2008
cool forum rubbish ppl..........
Reply With Quote  
Join Date: Dec 2005
Posts: 3,043
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 19
Solved Threads: 344
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: Simple awk help

  #4  
May 5th, 2008
Do you want to learn, or just sponge off everyone for the rest of your life?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Shell Scripting Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 3:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC