I'm trying to run experiments on a text file to get word frequencies. I tried using the following command:
gawk -F"[ ,'\".]" -v RS="" '{for(i=1;i<=NF;i++) words[$i]++;}END{for (i in words) print words[i]" "i}' myfile.txt | uniq -c | sort -nr | head -10
But I get the following error:
gawk: cmd. line:1: fatal: cannot open file '|' for reading (No such file or directory)
I read somewhere that ';' may be used instead of '|' on Windows machines, although this results in a similar error.
It seems as though it is reading the first instance of '|' as a file name. Is this the correct way of piping on a windows machine? Is piping possible on a windows machine using Cygwin?
EDIT: I added cygwin to windows PATH variable and then used cmd window. If i wanted to actually use cygwin.exe, does that mean I would have to place any files I wanted to edit within C:/cygwin ?