freq

count frequencies of keys in text
git clone git://bvnf.space/freq.git
Log | Files | Refs | README

commit 858e2460c2f7b51032552ec2bec8c87e6a687aa4
parent 1807bcc4ce93dfe03368f5a02ac8aaa81869f1ec
Author: phoebos <ben@bvnf.space>
Date:   Mon, 21 Mar 2022 20:10:35 +0000

add README from manpage

Diffstat:
AREADME | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+), 0 deletions(-)

diff --git a/README b/README @@ -0,0 +1,69 @@ +FREQ(1) General Commands Manual FREQ(1) + +NAME + freq - count frequencies of keys in text + +SYNOPSIS + freq [-d delim] [-k key] [file] + +DESCRIPTION + freq counts the frequencies of each specified field for each line of text + input. For each line, freq checks the field at the specified key and + increments the count for that value of the field. The rest of the line + is ignored. + + After checking every line, the counts for each value are printed, in the + order in which they are encountered for the first time. The results are + printed with the frequency, then a <tab> character, then the value of the + field. + + The following options are supported: + + -d delim + Set the field delimiter to the character delim. The default is + any character of class space in the current locale (see + isspace(3)). + + -k key Count the frequencies of the field found at position key, where + fields are separated by any number of delim characters. The + default value of key is 1, meaning that the first fields on each + line are counted. To use the whole line as a key, use the + special value of 0. If key fields are not found on a line, a + warning is printed and the whole line is ignored. + +OPERANDS + file A pathname of an input file. If no file operand is specified, or + if the file operand is `-', then standard input is used. + +EXIT STATUS + The freq utility exits 0 on success, and >0 if an error occurs. + +EXAMPLES + For a file named notes, containing the following data: + + I bought pears + You sold apples + I bought apples + I bought oranges + I sold bananas + You ate bananas + + Below are some examples of various invocations of freq with their + outputs: + + $ freq notes + 4 I + 2 You + + $ freq -k 2 notes + 3 bought + 2 sold + 1 ate + +SEE ALSO + cut(1), sort(1) + +AUTHORS + phoebos <ben@bvnf.space> + +ben's space March 21, 2022 ben's space