awk usuage


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk usuage
# 1  
Old 05-06-2008
awk usuage

can any1 guide me on simple awk to do extraction and calculation?
like for example if got data in 123.data how to i extract and sort the data giving my values like:
don,waiter,FnB,1500
mary,waitress,FnB,1500
alex,manager,hotel,2500
leo,ast manager,hotel,2000

how do i use this command to do a output like for example, under hotel what's the total wage as of the 4th field
which is alex's pay + leo's pay
and how do i do the amount of pay for FnB which is don's pay + mary's pay

appreciate the help. Cheers
# 2  
Old 05-06-2008
Don't post homework! Thread closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Generic command for Memory usuage on Linux and Solaris

Hi, I m using the below commands to find out the RAM and SWAP Memory usage on Linux. free -m while I m using the below for Solaris prstat -cZ 1 1 Is there a generic command that I can used for both Linux and Solaris to get RAM and SWAP memory usage ? (3 Replies)
Discussion started by: mohtashims
3 Replies

2. Shell Programming and Scripting

awk output yields error: awk:can't open job_name (Autosys)

Good evening, Im newbie at unix specially with awk From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example 1. This is the inputfile: $ more MapaRep.txt ds_extra_nikira_usuarios... (18 Replies)
Discussion started by: alexcol
18 Replies

3. Shell Programming and Scripting

Passing awk variable argument to a script which is being called inside awk

consider the script below sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml awk -F'' '{for(i=1;i<=NF;i++){ if($i=="Alert id") { if(id!="") if(dt!=""){ cmd="sh someScript.sh... (2 Replies)
Discussion started by: vivek d r
2 Replies

4. UNIX for Dummies Questions & Answers

. and / usuage

From what I have read . is for current director and the / represents directory. So I have a file hello.c in order to run that file I have to type ./hello which is a compiled C program. If I put a space after the ./ I recieve ./ is a directory. However if I use the cp command cp... (2 Replies)
Discussion started by: Fingerz
2 Replies

5. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

6. Shell Programming and Scripting

awk command to compare a file with set of files in a directory using 'awk'

Hi, I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files. To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies

7. UNIX for Dummies Questions & Answers

Alias Usuage

Hi All I am new to the Unix World.I have question about alias.I learnt that alias allows to have a small more familiar command or name to execute a long string.I understand that I use C shell command and emacs editor I tried editing the .cshrc.common file in order to set my environment... (5 Replies)
Discussion started by: Ratna_Ranjan
5 Replies

8. Shell Programming and Scripting

Awk problem: How to express the single quote(') by using awk print function

Actually I got a list of file end with *.txt I want to use the same command apply to all the *.txt Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics. For example: I got the file below: file1.txt file2.txt file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies

9. Solaris

Memory usuage per zone in solaris

Hello all, How can i find the memory usuage per zone in solaris. (5 Replies)
Discussion started by: sophos
5 Replies

10. HP-UX

monitor memory usuage

Hi, We have HP-UX 11.23 and i want to use glance utility to monitor the memory usuage. Can someone tell me how to sort by memory usuage in glance utility? Thx (1 Reply)
Discussion started by: rockcapri
1 Replies
Login or Register to Ask a Question