If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > string handling

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-04, 01:36
ravindragariya ravindragariya is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
string handling

haow can i count occurences of s substring in a given string
Reply With Quote
  #2 (permalink)  
Old 05-20-04, 06:42
hanuman hanuman is offline
Registered User
 
Join Date: Dec 2003
Posts: 6
Lightbulb

Check the following,
I am assuming that the string which you are checking is there in a file.

*************************************
sed 's/pattern/\
\BUZZWORDXYZ\
\/g' yourfile | grep -c BUZZWORDXYZ ;

************************************
Hope this will work for you..

Have Fun,
Hanuman.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On