10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How do you write a script that counts the number of times a word appears in a file and output it?
Original:
ID1 SMARCB1;Adil;Jon
ID2 Jon;Annie;Mei
ID3 Adil;Spaghetti;NBA
ID4 Raptors;wethenorth;SMARCB1
ID5 SMARCB1;wethenorth
Objective:
SMARCB1: 3
Adil: 2
Jon: 2... (5 Replies)
Discussion started by: Lipidil
5 Replies
2. Shell Programming and Scripting
Hi friends
i need a help on Perl Script
In My Home directory, i have some other directories and inside those directories i have some subdirectories and all the directories contains files.
Now i want to count a word in all files and i want the output like below
wordcount in which file(name... (5 Replies)
Discussion started by: siva kumar
5 Replies
3. Shell Programming and Scripting
Hi all,
I am trying to write a script substituting one word in a particular file with another word (sed) but I'm having trouble creating the backup file. The following are my instructions:
The Unix program sed is useful for making simple substitutions throughout an entire file. But one of... (0 Replies)
Discussion started by: Hoppy56
0 Replies
4. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
It was the best of times, it was the worst of times,
It was the age of wisdom, it was the age of foolishness,
It was the epoch of belief, it was the epoch of incredulity,
It was the season of Light, it was the season of Darkness,
It... (3 Replies)
Discussion started by: bigubosu
3 Replies
5. UNIX for Dummies Questions & Answers
In a file I have to count a particular word. like i need apache how many times.
I tried this
$ tr "\011" "\012\012"<foo1 | tr -cd "" |sort\uniq -c
but I got result like this
32 apache
18 dns
12 doctor
Please sugest me (4 Replies)
Discussion started by: pranabrana
4 Replies
6. Shell Programming and Scripting
I am trying to substitute something with sed and what I want is to substitute a whole
word and not part of a word. ie
sed 's/class/room/g' filename
will substitute both class and classes into room and roomes which is not what i want
Grep for instance can use the -w option or <>
grep -w... (7 Replies)
Discussion started by: gikay01
7 Replies
7. Linux
Hi All,
I have a quary regarding grep command in linux.
I have a file which contains
56677
56677
+56677
+56677
56677
56677
56677
I want to extract total count of "56677"
When I hit the following command
#cat filename | grep -w -c '56677'
the result comes 7. Its counting... (3 Replies)
Discussion started by: maddy
3 Replies
8. Linux
Ok this is last question of the day from my side .
I have this file and I want to replace the last letter " , " with " ) " .
The input file is
#cat zip.20080604.sql
CONNECT TO TST103 ;
SET SESSION_USER OPSDM001 ;
SET CURRENT SCHEMA OPSDM001 ;
CREATE VIEW OPSDM001.vw_zip SELECT (
... (4 Replies)
Discussion started by: capri_drm
4 Replies
9. Linux
Hi I am trying to substitute 2 words on the same line with _S02 as suffix. Like this .
IN "TSOPS09" INDEX IN "TSOPIX09" ;
to
IN "TSOPS09_S02" INDEX IN "TSOPIX09_S02" ;
i used the following code to make the change , it works fine for first substitution not the second one .
... (6 Replies)
Discussion started by: capri_drm
6 Replies
10. Shell Programming and Scripting
I have data that looks something like this:
term1/term2/2005-12-01 13:20:30/term4
I need to make it look like this:
term1/term2/20051201132030/term4
I am using a csh script. I have tried to do it by first converting the date/time to the format in which I want it, and then replacing it... (1 Reply)
Discussion started by: oprestol
1 Replies