How do I extract all words from all files in a given directory in order to make a dictionary? The words must be different from each other(letters in caps are not taken into consideration. For example, car=Car), they will be written with small letters in the dictionary(even if in originally they had caps), they will be sorted alphabetically and each line in the dictionary will contain only one word. The dictionary will be in /home/dictionary.txt.
|
|
johnny, I think what you want to do could easy be done in a bash script. But you are going to want to study up on redirection, input files... ; should get you going hopefully. | For getting words or patterns... |
||||
|
|
|
Depends heavily on the contents of the directory, but... this should be at least a very good start if we are talking about plain text files in the directory in question.
About the switches, Remove numbers: Remove blank lines: |
|||||
|
|
You can do this with awk
"print tolower" simply converts to all lower case (makes sort -u work). The sed removes trailing periods, you may or may not need to manage other symbols depending on your input files. |
|||||||||||
|