Sponsored Content
Full Discussion: Count unique words
Top Forums UNIX for Beginners Questions & Answers Count unique words Post 302991748 by RudiC on Thursday 16th of February 2017 03:25:36 AM
Old 02-16-2017
How about sth along this line?
Code:
for FN in *.txt
  do    TMP=${FN##*_}
        TMP=${TMP%%[0-9]*}
        echo "if(filename==$TMP)"
        echo count total and unique words
        echo
  done
if(filename==Page)
count total and unique words

if(filename==Front)
count total and unique words

.
.
.

Please note that your pseudo code is not somewhere near any real code doing what you seem to describe.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to read all the unique words in a text file

How can i read all the unique words in a file, i used - cat comment_file.txt | /usr/xpg6/bin/tr -sc 'A-Za-z' '/012' and cat comment_file.txt | /usr/xpg6/bin/tr -sdc 'A-Za-z' '/012' but they didnt worked..... (5 Replies)
Discussion started by: aditya.ece1985
5 Replies

2. Shell Programming and Scripting

Finding the number of unique words in a file

find the number of unique words in a file using sort com- mand. (7 Replies)
Discussion started by: abhikamune
7 Replies

3. Shell Programming and Scripting

Shell script to find out words, replace them and count words

hello, i 'd like your help about a bash script which: 1. finds inside the html file (it is attached with my post) the code number of the Latest Stable Kernel, 2.finds the link which leads to the download location of the Latest Stable Kernel version, (the right link should lead to the file... (3 Replies)
Discussion started by: alex83
3 Replies

4. Homework & Coursework Questions

unique words in files of folder and its subfolders

Hello, I tried to count all unique words of all files in one folder and its subfolders. Can anybody say me, why this doesnt work: ls| find -d | cat | tr "\ " "\n"| uniq -u | wc -l ??? Cat writes only the names of those files, but not the wors, which should be in them. Thanks for any advice. ... (9 Replies)
Discussion started by: Dworza
9 Replies

5. Shell Programming and Scripting

display unique words.

I am having a file with duplicate words how can I eliminate them ant,bat bat,cat cat a.txt | grep -bat | awk '{print $1}' expecting o/p as ant,bat,cat How can I display the output as ant,bat,cat in a single line and no duplicates exists. (2 Replies)
Discussion started by: shikshavarma
2 Replies

6. Shell Programming and Scripting

Unique words in each line

In each row there could be repetition of a word. I want to delete all repetitions and keep unique occurrences. Example: a+b+c ab+c ab+c abbb+c ab+bbc a+bbbc aaa aaa aaa Output: a+b+c ab+c abbb+c ab+bbc a+bbbc aaa (6 Replies)
Discussion started by: Viernes
6 Replies

7. Shell Programming and Scripting

awk to count using each unique value

Im looking for an awk script that will take the unique values in column 5, then print and count the unique values in column 6. CA001011500 11111 11111 -9999 201301 AAA CA001012040 11111 11111 -9999 201301 AAA CA001012573 11111 11111 -9999 201301 BBB CA001012710 11111 11111 -9999 201301... (4 Replies)
Discussion started by: ncwxpanther
4 Replies

8. Shell Programming and Scripting

How count the number of two words associated with the two words occurring in the file?

Hi , I need to count the number of errors associated with the two words occurring in the file. It's about counting the occurrences of the word "error" for where is the word "index.js". As such the command should look like. Please kindly help. I was trying: grep "error" log.txt | wc -l (1 Reply)
Discussion started by: jmarx
1 Replies

9. Shell Programming and Scripting

Count occurrence of column one unique value having unique second column value

Hello Team, I need your help on the following: My input file a.txt is as below: 3330690|373846|108471 3330690|373846|108471 0640829|459725|100001 0640829|459725|100001 3330690|373847|108471 Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies

10. Shell Programming and Scripting

Regex to identify unique words in a dictionary database

Hello, I have a dictionary which I am building for the Open Source Community. The data structure is as under HEADWORD=PARTOFSPEECH=ENGLISH MEANING as shown in the example below अ=m=Prefix signifying negation. अँहँ=ind=Interjection expressing disapprobation. अं=int=An interjection... (2 Replies)
Discussion started by: gimley
2 Replies
SHTOOL-VERSION.TMP(1)					      GNU Portable Shell Tool					     SHTOOL-VERSION.TMP(1)

NAME
shtool-version - GNU shtool maintain version information file SYNOPSIS
shtool version [-l|--language lang] [-n|--name name] [-p|--prefix prefix] [-s|--set version] [-e|--edit] [-i|--increase knob] [-d|--display type] file DESCRIPTION
This command displays and maintains version information in file. The version is always described with a triple <version,revision,level> and is represented by a string which always matches the regular expression ""[0-9]+.[0-9]+[sabp.][0-9]+"". The hexadecimal format for a version "v.rtl" is "VVRRTLL" where "VV" and "RR" directly correspond to "v" and "r", "T" encodes the level type as 9, 2, 1, 0 (representing "s", "p"/".", "b", "a" in this order) and "LL" is either directly corresponding to "l" or set to 99 if level type is "s". OPTIONS
The following command line options are available. -v, --verbose Print verbose information during processing. -l, --language lang Choose format of version file file. lang=""txt"", ANSI C (lang="c"), M4 (lang="m4"), Perl (lang="perl") or Python (lang="python"). Default is "txt". -n, --name name Name the program the version is maintained for. Default is "unknown". -p, --prefix prefix =item -s, --set version Set the version to version. -e, --edit Interactively enter a new version. -i, --increase knob When option ``-i'' is used, the current version in file is updated by increasing one element of the version where knob can be one of the following: ``"v"'' for increasing the version by 1 (and resetting revision and level to 0), ``"r"'' for increasing the revision by 1 (and resetting level to 0) or ``"l"'' for increasing the level by 1. -d, --display type Control the display type: ""short"" for a short version display, ""long"" for a longer version display, ""hex"" for a hexadecimal display of the version and ""libtool"" for a format suitable for use with GNU libtool. EXAMPLE
# shell script shtool version -l c -n FooBar -p foobar -s 1.2b3 version.c # configure.in V=`shtool version -l c -d long version.c` echo "Configuring FooBar, Version $V" HISTORY
The GNU shtool version command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1994 for OSSP eperl. It was later rewritten from scratch for inclusion into GNU shtool. SEE ALSO
shtool(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-VERSION.TMP(1)
All times are GMT -4. The time now is 01:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy