Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.

Find text in file

Thread Tools Search this Thread
# 1  
Find text in file

Hello i a script:

for iname in `cat mysong`
  for cname in `cat mysong`
    if  [ "$iname" = $cname ]
       count=`expr $count + 1`
    echo "word: $iname - found in the text: $count times" 

the proplem: how i can print not duplicated words. (i can't use sort and unic )

my output:
word: I - found in the text: 8 times
word: I - found in the text: 8 times

Thank you

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How to find numbers in text file?
Hi I have a text file with rows like this: 7 Herman ASI-40 Jungle (L) Blueprint (L) Weapon Herman ASI-40 Jungle (L) 215.00 57 65.21 114.41 and 9 Herman CAP-505 (L) Blueprint (L) Weapon Herman CAP-505 (L) 220.00 46.84 49.1 104.82 and 2 ClericDagger 1C blueprint Melee - Shortblade...... Shell Programming and Scripting
Shell Programming and Scripting
Find redundant text in a file
I want to find which pattern or strings have occurred more than one time so that I can remove unnecessary redundancy. For example: If I have the sentence: A quick brown brown fox jumps jumps jumps over the lazy dog in a file, then I want to know that 1. the word "brown" has...... Shell Programming and Scripting
Shell Programming and Scripting
Find ^Z in a unix text file
Hi Everybody, I have an unknown number of files that for some reason contain the ^Z character. I would need a command that helps me identifying these files. Here is an example of a line: JUAN HERN^ZNDEZ I would greatly appreciate your help. Thanks in advance, Sebastian... Shell Programming and Scripting
Shell Programming and Scripting
find a string in a file and add some text after that file
Hi Could you please help me out by solving teh below problem ? I have a file with as below source1|target1|yes source2|target2|no source1 is file in which i have to place some code under the <head> tag in it. What code i have to place in source1 is something like this "abcd.....<target1>...... Shell Programming and Scripting
Shell Programming and Scripting
How to find exact text in file ?
I have file named shortlist , and it contains this: 2233|charles harris |g.m. |sales |12/12/52| 90000 9876|bill johnson |director |production|03/12/50|130000 5678|robert dylan |d.g.m. |marketing |04/19/43| 85000 2365|john woodcock |director |personnel...... UNIX for Dummies Questions & Answers
UNIX for Dummies Questions & Answers

Featured Tech Videos