Sponsored Content
Full Discussion: Unix addition ( Row wise)
Top Forums Shell Programming and Scripting Unix addition ( Row wise) Post 302117893 by gauravgoel on Thursday 17th of May 2007 04:09:11 AM
Old 05-17-2007
Unix addition ( Row wise)

Hi

I have a file like

a,1
b,2
d,3
a,2
b,3
c,7


Result Desired:
a,3
b,5
d,3
c,7

i.e on the bases of 1st field the addition is done of the 2nd field and result printed out.

Thanks
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Addition of numbers in unix

Hi I have a file with specified format . Hxxxxxxxyyyyyggggggguuuuuuuuuurrrrrrrrrrrrrrrrrrrrrrrr xxxxxxxxyyyyyggggggguuuuuuuuuurrrrrrrrrrrrrrrrrrrrrrrr xxxxxxxxyyyyyggggggguuuuuuuuuurrrrrrrrrrrrrrrrrrrrrrrr xxxxxxxxyyyyyggggggguuuuuuuuuurrrrrrrrrrrrrrrrrrrrrrrr... (3 Replies)
Discussion started by: asinha63
3 Replies

2. Shell Programming and Scripting

User addition in Unix box

Hi All, Am using the following command to add a user in Unix box useradd -d <default_path> -g 90 -p <pwd for the user> <user_name> But am getting an error while using this command by root user.Let me know if this cmd is right or else is there any other command to add a user in unix... (9 Replies)
Discussion started by: Ashok_oct22
9 Replies

3. Shell Programming and Scripting

awk-gsub on column-wise on each row

awk '{ gsub(/....=/,""); print }' want.dat >final.dat the above awk command which removes all the chars before and including '=' on the entire row. --thats what it meant be.:) but i need to remove text on column-wise on each row. many thanks, EM ---------- Post updated at 10:00 AM... (4 Replies)
Discussion started by: elamurugu
4 Replies

4. Shell Programming and Scripting

Loop for row-wise averaging of multiple files using awk

Hello all, I need to compute a row-wise average of files with a single column based on the pattern of the filenames. I really appreciate any help on this. it would just be very difficult to do them manually as the rows are mounting to 100,000 lines. the filenames are as below with convention as... (2 Replies)
Discussion started by: ida1215
2 Replies

5. Shell Programming and Scripting

addition of values in row

file content are like this sam,22,29,23,24,25,26,22 i want to add the values from column 3 (fix column no) to as per user input say up to column 8 (variable as per user) can we do this without using "awk" for each column (as number of columns are variable as per user input ) Thanks in... (5 Replies)
Discussion started by: sagar_1986
5 Replies

6. Shell Programming and Scripting

calculating row-wise standard deviation using awk

Hi, I have a file containing 100,000 rows-by-120 columns and I need to compute for the standard deviation for each row. Any idea on how to calculate row-wise standard deviation using awk? My sample data looks like this: input data: 23 35 12 25 16 17 18 19 29 12 12 26 15 14 15 23 12 12... (2 Replies)
Discussion started by: ida1215
2 Replies

7. Shell Programming and Scripting

How to pass parameter to pipe command row-wise?

Hi, I have a list of parameter in a file. I want to pass them one by one to piped command and syntax is like <command> <parameter> <command continues> How to achieve that ? Thanks (1 Reply)
Discussion started by: ezee
1 Replies

8. Shell Programming and Scripting

Search/grep on row and column wise

Hello, I have a comma seperate metadata as follows: CITY ,COUNTY,STATE,COUNTRY NEW_YORK,NYC ,NY ,USA NEWARK ,ESSEX ,NJ ,USA CHICAGO ,COOK ,IL ,USA SEATTLE ,MINER ,WA ,USA In my process, I get two key values ie CITY NAME (can be one of the... (7 Replies)
Discussion started by: calredd
7 Replies

9. UNIX for Dummies Questions & Answers

Print row wise

Hi Help, I have an I/p, which looks like --- FF GG HH I want the o/p to be like --- FF GG HH. How we can do that? Thanks (7 Replies)
Discussion started by: Indra2011
7 Replies
Jifty::Result(3pm)					User Contributed Perl Documentation					Jifty::Result(3pm)

NAME
Jifty::Result - Outcome of running a Jifty::Action DESCRIPTION
"Jifty::Result" encapsulates the outcome of running a Jifty::Action. Results are also stored on the framework's Jifty::Response object. new Construct a new action result. This is done automatically when the action is created, and can be accessed via the "result" in Jifty::Action. failure [BOOL] Gets or sets if the action succeeded or failed. success [BOOL] Gets or sets if the action succeeded or failed -- this is an alternate interface from "failure" but has the same effect. action_class [MESSAGE] Returns the class for the action that this result came from. message [MESSAGE] Gets or sets the action's response message. This is an informational textual description of the outcome of the action. error [ERROR] Gets or sets the action's error response. This is an informational textual description of what went wrong with the action, overall. This also automatically sets the result to be a "failure". field_error FIELD [ERROR] [OPTIONS] Gets or sets the error string for a specific field on the action. This also automatically sets the result to be a failure. "OPTIONS" is an optional set of key-value pairs; the only currently supported option is "force", which sets the "ajax_force_validate" for this field. field_errors Returns a hash which maps argument name to error. field_warning FIELD [WARNING] [OPTIONS] Gets or sets the warning string for a specific field on the action. "OPTIONS" is an optional set of key-value pairs; the only currently supported option is "force", which sets the "ajax_force_validate" for this field. field_warnings Returns a hash which maps argument name to warning. ajax_force_validate FIELD [VALUE] Gets or sets the flag which determines if warnings and errors are set using ajax validation, even if the field is empty. By default, validation warnings and errors are not shown for empty fields, as yelling to users about mandatory fields they've not gotten to yet is poor form. You can use this method to force ajax errors to show even on empty fields. field_canonicalization_note FIELD [NOTE] Gets or sets a canonicalization note for a specific field on the action. field_canonicalization_notes Returns a hash which maps argument name to canonicalization notes. content [KEY [, VALUE]] Gets or sets the content "KEY". This is used when actions need to return values. If not "KEY" is passed, it returns an anonymous hash of all of the "KEY" and "VALUE" pairs. as_hash This returns the results as a hash to be given directly to the end user (usually via REST or webservices). The difference between "$result->as_hash" and %$result is that the latter will expand everything as deeply as possible. The former won't inflate "refers_to" columns, among other things. perl v5.14.2 2010-09-25 Jifty::Result(3pm)
All times are GMT -4. The time now is 08:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy