Computing.Net > Forums > Unix > Help simple AWK

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

Reply to Message Icon

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.. :/



Sponsored Link
Ads by Google

Response Number 1
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

Related Posts

See More



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'.



0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Help simple AWK

Help with AWK to extract text block www.computing.net/answers/unix/help-with-awk-to-extract-text-block/7987.html

Help with awk/sed www.computing.net/answers/unix/help-with-awksed/6548.html

Help w/ awk problem? Will pay! www.computing.net/answers/unix/help-w-awk-problem-will-pay/4021.html