Thanks a lot. For my own learning, if I add one more column as following
id task time
1 abc 11
2 abc 14
3 xyz 10
How would the script variable look like?
Depends on your desired output.
What is the reporting 'key'?
If it's still 'task' (regardless of the id), just change '$1' to '$2'
---------- Post updated at 12:57 PM ---------- Previous update was at 12:56 PM ----------
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
Thank You.
The UNIX and Linux Forums
---------- Post updated at 01:01 PM ---------- Previous update was at 12:57 PM ----------
Hello All,
I saw this problem on one of the forum and solved it using group-by in oracle sql, though I am a bit curious to implement it using shell script :
There is a file having number of operations :
Opeation,Time-Taken
operation1,83621
operation2,72321
operation3,13288... (11 Replies)
Hi,
I want to know if there is any simple approach to SUM a field based on group by of different fields
for e.g.
file1.txt contains below data
20160622|XXX1||50.00||50.00|MONEY|Plan1|
20160622|XXX1||100.00||100.00|MONEY|Plan1|
20160623|XXX1||25.00||25.00|MONEY|Plan1|... (3 Replies)
Hi,
I have text file as shown below.
root 25 oracle 25 batch 30 griduser 32 admin 35
root 25 oracle 25 batch 30 griduser 32
oracle 25 batch 30 griduser 32 xuser 45 admin 35
I want to group by based on user name, and the output need to be as below. Not necessary the username to be... (10 Replies)
I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.
diff=$1$2.diff
id=$2 new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk... (2 Replies)
Hi,
I have a following file:
role.IMPACT_USER.user=admin
role.IMPACT_USER.user=dd12345
role.IMPACT_USER.user=ss76767
#role.IMPACT_USER.user=root
#role.IMPACT_USER.group=System
role.IMPACT_USER.group=ImpactUser
#Description: Allow users to login in to Impact, start and stop service... (5 Replies)
Hi, I want to read a file from the command line and remove all the spaces, tabs in it, replacing it with comma(,), and write it to a new file. can you help me out with this scenario. (1 Reply)
Hi,
I need help to split lines from a file into multiple files.
my input look like this:
13
23 45 45 6 7
33 44 55 66 7
13
34 5 6 7 87
45 7 8 8 9
13
44 55 66 77 8
44 66 88 99 6
I want to split every 3 lines from this file to be written to individual files. (3 Replies)
Hello,
I am having 1800 files in a directory with a specified format, like
amms_850o_prod.000003uNy
amms_850o_prod.000003u8x
amms_850o_prod.000003taP
amms_850o_prod.000003tKy
amms_850o_prod.000003si4
amms_850o_prod.000003sTP
amms_850o_prod.000003sBg
amms_850o_prod.000003rvx... (12 Replies)
Hi Experts,
The question may look very silly by seeing the title, but please have a look at it clearly.
I have a text file where the first 5 columns in each row were supposed to be attributes of a sample(like sample name, number, status etc) and the next 25 columns are parameters on which... (3 Replies)
Many of my servers' /etc/group file have many userid's that does not exist in /etc/passwd file and they need to be deleted.
This happened due to manual manipulation of /etc/passwd files.
I need to do this for 40 servers.
Can anyone help me in achieving this? Even reducing a step or two will be... (6 Replies)