|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Number of word occurences in a file?
Hello world,
Can anybody tell me how to count how many times does a word repeat in a file? There have been many threads on this but they all are heavy loads of Scripting for a starter like me. ![]() So, I sat down today and after some hours of reading man pages, I found a simple one-line execution. But, I cannot paste this in any threads as they are all closed! (Can the forum staff please let me know why threads are closed?? I really don't know). Your buddy, Satheesh ---------- Post updated at 09:17 AM ---------- Previous update was at 09:15 AM ---------- The reason I started this thread is either someone newbie benefits or I can be corrected if I went wrong somewhere. |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
Code:
perl -lne '$i++ while(/\bWORD\b/g);END{print $i}' inputfile |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
@satish51392111
You can post it here ![]() Threads are automatically closed, if not posted in, after a period of time (I think 6 months, but can't find the discussion thread we had on the subject ) |
|
#4
|
|||
|
|||
|
I'm very much new to *nix and so I posted it in this Forum-for-dummies. So, no scripting please. These one line scripts are in all the threads I went through earlier.
Also, why are the threads closed? |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Quote:
If you want to start a new thread on a similar subject, you can put a link to the old, closed thread. You really should be asking these questions in the support forum, not in the technical areas. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Ok, got it. I'll next time.
Back to my question please.. any simple suggestions? |
| Sponsored Links | |
|
|
#7
|
||||
|
||||
|
Nonsense... you can cut and paste from any thread, closed or not.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk counting number of occurences | phamp008 | Shell Programming and Scripting | 3 | 09-19-2009 12:52 PM |
| Count number of occurences of a word | shikhakaul | UNIX for Dummies Questions & Answers | 8 | 06-25-2009 11:10 AM |
| How to count the occurences of a specific word in a file in bash shell | mskart | UNIX for Dummies Questions & Answers | 2 | 10-30-2008 12:42 PM |
| no of occurences of q word | Satyak | Shell Programming and Scripting | 6 | 09-29-2008 02:38 AM |
| How to find all occurences of word? | vanitham | Web Programming | 0 | 09-06-2008 05:35 AM |
|
|