A contributor on another forum suggested defining the field separator as a string. Many thanks DaWei!
Here's the complete program:
# gawk -f word_freq.awk --posix file_to_process
# Outputs a list of words and word frequencies
# Words are defined as a string of alpha characters which may end...
Thanks, PHV
I tried using several POSIX statements like [[:punct:]] and [[:blank:]], but they were always ignored. Do I need to initialize POSIX in gawk. I thought these expressions were automatically available in gawk.
I’m running gawk for Win32 on a Win XP machine.
I’ve been trying to write a program that will count word frequencies when “words” are defined as alpha strings with at most two digits at the end, e.g. mp3. With the program below I experimented with various delimiters.
# Output list of word...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.