Frequency of Words in a File, sed script from 1980
This is not my script, it can be found way back from 1980 but once it worked fine to give me the most used words in a text file.
Now the shell is complaining about an error in sed
The instruction to this one liner tells to set it into an executable script, but lazy people ask, because in my former configuration it worked fine to find the most used words in a large text file. So can anyone give me a hint on the error of sed and its missing expression to the characters. I am trying this in the very directory where the file of book7.txt is located.
Thanks in advance.
Could someone please help me with the following.
I'm trying to figure out how to delete two words within a specific file using sed.
The two words are directory and named.
I have tried the following:
sed '//d' sedfile
sed '//d' sedfile
both of these options do not work.....
... (4 Replies)
lets see if i can explain this in a good way.
im trying to replace some words in a file but i need to know what the words are that is beeing replaced. not sure if sed can do this.
file.name.something.1DATA01.something.whatever
sed "s/./.DATA?????/g"
need to know what the first . is... (2 Replies)
I'm hoping someone could help me out please :)
I have several .txt files with several hundred lines in each that look like this:
10241;</td><td>10241</td><td class="b">x2801;</td><td>2801</td><td>TEXT-1</td></tr>
10242;</td><td>10242</td><td... (4 Replies)
This is a Nagios situation.
So i have a list of servers in one file called Servers.txt
And in another file called hostgroups.cfg, i want to remove each and every one of the servers in the Servers.txt file.
The problem is, the script I wrote is having a problem removing the exact servers in... (5 Replies)
Hi all,
I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line.
Let me paste an 2 examples:
anything before
any string begin
few lines of content
end1
anything after
anything before
any... (4 Replies)
I need to write a shell script "cmn" that, given an integer k, print the k most common words in descending order of frequency.
Example Usage:
user@ubuntu:/$ cmn 4 < example.txt :b: (3 Replies)
Hello,
I have a very large file of around 2 million records which has the following structure:
I have used the standard awk program to sort:
# wordfreq.awk --- print list of word frequencies
{
# remove punctuation
#gsub(/_]/, "", $0)
for (i = 1; i <= NF; i++)
freq++
}
END {
for (word... (3 Replies)
Hello,
I have a large file of syllables /strings in Urdu. Each word is on a separate line.
Example in English:
be
at
for
if
being
attract
I need to identify the frequency of each of these strings from a large corpus (which I cannot attach unfortunately because of size limitations) and... (7 Replies)
I have a file of names with the following structure
NAME FREQUENCY
NAME NAME FREQUENCY
NAME NAME NAME FREQUENCY
i.e. more than one name is assigned the same frequency. An example will make this clear
SANDHYA DAS 6901
ARATI DAS 6201
KALPANA DAS 4714
GITA DAS 4550
BISWANATH DAS 3949... (4 Replies)
I am having problems because some of my files have timestamps that are earlier that 1.1.1970, the Unix start of time convention.
So I would like to write a script that finds all files in home folder and subfolders with timestamps earlier than 1.1.1970 and converts them to 1.1.1980.
I... (3 Replies)