LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 11-28-2012, 07:30 AM   #1
pradeep rawat
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Rep: Reputation: Disabled
awk


i have a file
its like dis
id,name,id_2, type,success/failure,number
44,RAJ, 33, a,SUCCESS,30
40,JEY, 44,a,FAILURE,30
44,RAJ, 33, a,FAILURE,30
40,JEY, 44,a,FAILURE,30
40,JEY, 44,a,FAILURE,30
44,RAJ, 33,a,FAILURE,30

and i want output like this

id,name,id_2, type, success/failure,total,number,number2(total/3*3),number3(number2/number *100)
40,JEY,44,a,FAILURE=3/SUCCESS=0,Total=3,30,3,30
44,RAJ,33,a,FAILURE=2/SUCCESS=1,Total=3,30,3,30
 
Old 11-28-2012, 07:35 AM   #2
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 840

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
So..., what's the question?

What have you tried?
 
Old 11-28-2012, 07:41 AM   #3
pradeep rawat
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
i have tried doing it by awk bt i m able to take total bt i dont knw how to go for soo many columns
 
Old 11-28-2012, 07:43 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
You already have a thread on this......

duplicate reported

NOTE: please don't use texting shorthand here--spell out all your words

Last edited by pixellany; 11-28-2012 at 07:44 AM.
 
Old 11-28-2012, 07:49 AM   #5
pradeep rawat
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Original Poster
Rep: Reputation: Disabled
ya i m sorry for shorthand but insted of telling things can you help in this please.i m new here.
 
Old 11-28-2012, 09:07 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by pradeep rawat View Post
ya i m sorry for shorthand but insted of telling things can you help in this please.i m new here.
You already have people helping you in your other thread. If you have not already responded to their help / questions, please do so.

By advising you of the correct procedures, I AM helping you. If you don't see it that way, my apologies. I will help more in the other thread if I have time.
 
Old 11-28-2012, 12:46 PM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Moderator note: @pradeep rawat: this is the third thread about the same topic and every time your input is slightly different as well as the desired output. Please, keep the discussion in one place to avoid confusion. Moreover new answers can be different and more helpful if related to the previous ones. Said that, this thread is closed as a duplicate of http://www.linuxquestions.org/questi...ng-4175439068/.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED]Wierd AWK behavior / AWK not reading first line. Involar Linux - Newbie 9 11-28-2012 11:53 AM
running series of awk commands from an awk file oreka18 Programming 3 05-16-2012 02:13 AM
awk error awk: line 2: missing } near end of file boscop Linux - Networking 2 04-08-2012 11:49 AM
[SOLVED] call awk from bash script behaves differently to awk from CLI = missing newlines titanium_geek Programming 4 05-26-2011 10:06 PM
[SOLVED] awk: how can I assign value to a shell variable inside awk? quanba Programming 6 03-23-2010 03:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration