Could anyone help me with the following question, if I have two colums (names and frequency) as follows in a file called name.txt
and I want to use bash script called freqnames.sh that takes one argument (name) and the output should be the ALPHABETICALLY ORDERED list of all name's with the same frequency (popularity) as measured in the second column of the file.
For example.
./name.txt David
will return a list of three names (on separate lines) David, Jones, Michael,which have frequency 1.
Here is what I have tried so far but I don't know what else to add:
any help will be much appreciated
Last edited by vgersh99; 04-18-2011 at 01:10 PM..
Reason: code tags, please!
Thanks guys, But I would like to do it with grep only no awk. I tried another code shown below and I got an error saying that " line 2: a: command not found"
Any ideas how to make this work? thanks.
---------- Post updated at 11:35 AM ---------- Previous update was at 10:49 AM ----------
Thanks guys, I got it solved.. There should be no space on the sides of the "=" sign
Hi,
I have a file with more than 1 million records.. Each row has a distance number.. I want to know how many times is each number occurring from min to max number..
2
5
120
208
7
28
45
6
33
120
7
208
so onn..
output
0-0 (4 Replies)
Hi guys
I'm trying to configure a collaboration suit (PHP, PostgreSQL, Apache) plus a mail server(Sendmail and Dovecot) on a single box. It will be used heavily 24*7. So having a long up time is really needed. I'm looking for 3 to 6 month up time. I want to know about kernel update... (6 Replies)
Hi,
I would like to know how to find out frequency of memory, I have used the command prtconf but it is showing amt of ram available on server, it is not showing frequency.
Regards,
Manoj (1 Reply)
Hello,
I have a column where there are values from 1 to 150.
I want to get the frequency of values in the following ranges:
1-5
6-10
11-15
....
....
....
146-150
How can I do this in a for loop?
Thanks,
Guss (1 Reply)
Hi,
I have a file containing the frequency's of an element sorted in ascending order. The file looks something like this:
#Element Frequency
1 1
2 1
3 1
4 1
5 1
6 ... (5 Replies)
How is it possible to sort different nummeric values within an Array. But i don`t want the highest or the lowest. I need the most frequently occurring value.
For examble:
My Array has to following values = (200 404 404 500 404 404 404 200 404)
The result should be 404
The values are... (3 Replies)
I'd like to create a script that keeps track of the commands used.
For example:
count ls ps
and from now on whenever I use ls or ps a counter is increased.
I want that after the command count has been activated a session starts(here I can use any commands) and I want to stop the session... (5 Replies)
:cool: after installing solaris 10 5/08/09 directory the computer rebooting then the massage "out of frequency" appear.i want a solution first
second my main board is GA-MA780G UD3H (14 Replies)