Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Help simple AWK
Name: UxNewbie Date: April 21, 2004 at 11:04:37 Pacific OS: WinME CPU/Ram: 384
Comment:
How do you count and display the frequency of occurrence of each letter in alphabet (ignore case).For example abc as input file.
I tried searching on google before posting here but I m not sure.I m now learning AWK part and just started on shell programming.This is AWK question.Lets make it simple awk script ok? Just to clarify Shell programming and AWK scripting is different in my course.. :/
Name: UxNewbie Date: April 21, 2004 at 22:13:07 Pacific
Reply:
no help at all? =(
0
Response Number 2
Name: Wolfbone Date: April 21, 2004 at 23:10:11 Pacific
Reply:
Read the gawk info page, look at the word sorting example in the sample programmes -> miscellaneous programmes node and adapt it.
0
Response Number 3
Name: UxNewbie Date: April 22, 2004 at 00:43:49 Pacific
Reply:
If I know how to do it myself,I ll not even post here.
0
Response Number 4
Name: Wolfbone Date: April 22, 2004 at 01:12:20 Pacific
Reply:
You will not do well in your course if you show absolutely no initiative at all. If you follow my advice and copy the wordfreq.awk example as I have suggested and then do:
awk -F "" -f wordfreq.awk some_text_file
you will see how easy it is, with a tiny bit of extra work to get the result you seek.
0
Response Number 5
Name: UxNewbie Date: April 22, 2004 at 03:04:49 Pacific
Reply:
I m searching for awk program that count/display the frequency of occurrence of LETTER in alphabet.But you are showing me an example of counting WORDS.See the difference?
-_-'
0
Response Number 6
Name: Wolfbone Date: April 22, 2004 at 03:31:42 Pacific
Reply:
Clearly you are having trouble following simple instructions. If you had done so you would have noticed the effect of the -F "" option on the wordfreq.awk programme.
In the time it has taken you to compose your sarcastic reply, you could have made the trivial alteration to the wordfreq.awk file that stops it counting number and underscore occurrences and tested it out on some text files, perhaps piping it into 'sort' or 'sort -nk2'.
Summary: Hi there I am hoping you could help me with a script that would search for a word and extract the block of text containing it. This is a log file containing multiple messages. I would like to first se...
Summary: Dear Friends: I currently have a script that does a simple grep on "failed_logon" and emails them to me. It's rather ugly. How can I use awk to search on failed_logon and report it by type of f...
Summary: I am a Windows user trying to learn how to use Unix, so forgive me if I need short-bus type answers. Can someone help me with this issue? I need to use an awk script on a file. the file has 3 fields...