Please find the following awk script which counts the frequency of words from input file.
Program
#this awk script reads every line from input file and counts the
frequency
#of it
awk '
{
for (i=1; i<=NF; i++) {
words[$i]++
}
}
END {
printf("Count Word\n----- ----\n")
for (w in words)
printf("%3d %s\n", words[w], w)
} ' $1
Sample Input File:
USER > cat input_words
This is a file with many words.
Some of the words appear more than once.
Some of the words only appear one time
rajini Rajni rajini dix
Sample Output
USER: ./count_words.sh input_words
Count Word
----- ----
1 dix
1 file
2 Some
1 time
1 with
1 once.
2 of
1 This
1 more
1 a
1 Rajni
2 words
1 words.
1 only
1 many
2 the
1 one
2 rajini
1 than
2 appear
1 is
Write an awk script that prints a list of all the words in an input file along with the number of...
write a script named word_counts.sh that prints out how many words are on each line of standard input, as well as the total number of words at the end. The script should take no arguments. Instead, the script must work by reading every line of standard input (using a while loop) and counting the number of words on each line separately. The script is intended to work with standard input coming from a pipe, which will most often come from...
Description: Overview: You will write a program (says wordcountfreq.c) to find out the number of words and how many times each word appears (i.e., the frequency) in multiple text files. Specifically, the program will first determine the number of files to be processed. Then, the program will createmultiple threads where each thread is responsible for one file to count the number of words appeared in the file and report the number of time each word appears in a global linked-list....
Write an awk script to print just the name and size of ordinary files (do not include directories), one on each line. The output must be aligned as shown in the example below. First, analyze a typical output of the ls -l command to see what differentiates an ordinary file from a directory and which fields contain the file name and size information. Then, determine what the field separator is and whether the default field separator of awk will work,...
Write a program that first reads in the name of an input file and then reads the file using the csv.reader() method. The file contains a list of words separated by commas. Your program should output the words and their frequencies (the number of times each word appears in the file) without any duplicates. Ex: If the input is: inputl.csv and the contents of input1.csv are: hello, cat, man, hey, dog, boy, Hello, man, cat, woman, dog, Cat, hey, boy the output is: hello 1 cat 2 man...
(Python 3) Write a program that reads the contents of a text file. The program should then create a dictionary in which the keys are individual words found in the file and the values are the number of times each word appears and a list that contains the line numbers in the file where the word (the key) is found. Then the program will create another text file. The file should contain an alphabetical listing of the words that are...
using matlab Write a script to make a game that chooses a word (from a list of ten different six-letter words created in the script). The script scrambles the letters (we made a script for that! use it) and shows it to the user, the user has 3 chances to type in the correct unscrambled word. If the user gets it wrong 3 times the the game calls the user a LOSER!!! Write a script to make a game that...
in c++ please. Write a program that reads the contents of a text file. The program should create a map in which the keys are the individual words found in the file and the values are the number of times each word appears. For example, if the word "the" appears 128 times, the map would contain an element with "the" as the key and 128 as the value. The program should either display the frequency of each word or create...
Write a program that opens a specified text file and then displays a list of all the unique words found in the file. Hint: Store each word as an element of a set. USING PYTHON Please provide a screenshot of the input
Write an awk command that will calculate the sum of all digits in a specified file. So the number 251 would be 2+5+1, it would do this for all numbers found in a file providing just sum as the output.
Write a program IN PYTHON that checks the spelling of all words in a file. It should read each word of a file and check whether it is contained in a word list. A word list available below, called words.txt. The program should print out all words that it cannot find in the word list. Requirements Your program should implement the follow functions: main() The main function should prompt the user for a path to the dictionary file and a...