Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Number of word occurences in a file? Post 302604137 by satish51392111 on Saturday 3rd of March 2012 09:17:10 AM
Old 03-03-2012
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. Smilie
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.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

number of occurences of a string

hi, I have a file where i need to count the occurences of a string ex) 'welcome to unix forum'. can anybody help me out (12 Replies)
Discussion started by: siddu_chittari
12 Replies

2. UNIX for Dummies Questions & Answers

Counting number of occurences

Hi All, I have to count the number of occurences of the character " ; " in a given line. I had used the following awk command to achieve the same echo $KOP.dat|awk '{split($1,my,";"); for(i in my)c++ }END{print c-1}' My file KOP.dat had the following data ... (1 Reply)
Discussion started by: kingofprussia
1 Replies

3. Web Development

How to find all occurences of word?

Hi, For example lets consider i have word like this:cell I have some text that is stored in table. These are few sentences. TRAP also regulates translation of trpE by promoting formation of an cell. In addition initiation of pabA, trpP and ycbK by directly blocking cells. I... (0 Replies)
Discussion started by: vanitham
0 Replies

4. Shell Programming and Scripting

no of occurences of q word

hi I hace a string "abc,def,ghi,abc,def ,ghi,abc,def,ghi,abc,def ,ghi,abc" i replaced commas with spaces, now i want to calculate nof occurences of "abc" word. thanks in advance Satya (6 Replies)
Discussion started by: Satyak
6 Replies

5. UNIX for Dummies Questions & Answers

How to count the occurences of a specific word in a file in bash shell

Hello, I want to count the occurences of a specific word in a .txt file in bash shell. Can somebody help me pleaze?? Thanks!!! (2 Replies)
Discussion started by: mskart
2 Replies

6. Shell Programming and Scripting

counting the number of occurences

say i've got a text file with >10million sequences: ssss ssss tttttt uuuuuu uuuuuu uuuuuu ... I'd like to convert the file so that the output will report the number of occurence right by each sequence: 2 ssss 2 ssss 1 tttttt 3 uuuuuu 3 uuuuuu 3 uuuuuu .... (3 Replies)
Discussion started by: johjoh
3 Replies

7. UNIX for Dummies Questions & Answers

Count number of occurences of a word

I want to count the number of occurences of say "200" in a file but that file also contains various stuff including dtaes like 2007 or smtg like 200.1 so count i am getting by doing grep -c "word" file is wrong Please help!!!!! (8 Replies)
Discussion started by: shikhakaul
8 Replies

8. Shell Programming and Scripting

Sort the file based on number of occurences

I have a file (input) I want to sort the file based on the number of times a pattern in the first column occurs for example grapes occurs 4 times in combination with other patterns so i want it to be first like shown in the output file. then apple ocuurs thrice so it occupies second position and so... (7 Replies)
Discussion started by: anurupa777
7 Replies

9. Shell Programming and Scripting

Number of Consecutive Occurences

:b: Hi Folks, I have a requirement to find the number of consecutive occurences based on month. Here is the below sample of my requirement. I have say four columns CARUSERNAME BRAND_CODE MONTH YEAR Below is sample Data John|C|JAN|2013 Tim|C|FEB|2013 Tom|C|Mar|2013 Ron|C|Apr|2013... (4 Replies)
Discussion started by: dinesh1985
4 Replies

10. UNIX for Beginners Questions & Answers

Count occurences of the word without it repeating

Hi, I would like to count the number of ALA occurences without having them to be repeated. In the script I have written now it has 40 repetitions of ALA but it has to be 8. ALA is chosen as one of the 20 values it can have when the script asks for the input of AAA, which for this example is chosen... (7 Replies)
Discussion started by: Aurimas
7 Replies
aio_monitor_run_sec(5)						File Formats Manual					    aio_monitor_run_sec(5)

NAME
aio_monitor_run_sec - frequency of AIO thread pool monitor execution (in seconds) VALUES
Failsafe Default Allowed values Recommended values DESCRIPTION
The implementation of POSIX AIO on HP-UX uses kernel threads to perform I/Os to filesystems that do not directly support true asynchronous I/O. (This distinction is transparent to the user.) The kernel threads are organized into worker-thread pools (called AIO thread pools) created on a per-process basis. Since a thread pool mechanism for I/Os introduces a variety of trade-offs concerning utilization of CPU time vs. I/O resources, four dynamic tunables are available to customize the behavior of this thread pool: and Please see individual man- pages for details on each of these tunables. The tunable specifies how frequently a process' AIO thread pool will be monitored. Monitoring involves making decisions about growing or shrinking the AIO thread pool based on the constraints specified by and Note that although the AIO thread pool can grow both on its own (as new I/Os are issued) or as a result of the monitoring mechanism, the monitoring mechanism is the primary method by which the thread pool can shrink. So this tunable effectively determines how quickly the AIO thread pool will adapt itself to a given I/O load. Who Is Expected to Change This Tunable? System administrators that run applications requiring heavy usage of POSIX AIO to filesystems. Restrictions on Changing This tunable is dynamic. Changes to to this tunable take effect immediately for new processes started after the change. They also impact existing processes, but the speed with which the changes propagate to running processes is determined by the former value of When Should the Value of This Tunable Be Raised? should be raised for applications that have steady I/O loads for which POSIX AIO would rarely need to adapt. Another possibility is appli- cations with bursty or periodic I/O loads, that want POSIX AIO to maintain a larger thread pool through periods of decreased I/O activity (to be ready for busier periods). This can be accomplished by increasing this tunable to reduce the frequency of AIO monitor updates. What Are the Side Effects of Raising the Value of This Tunable? Increasing this tunable will reduce the speed with which the POSIX AIO thread pool mechanism adapts itself to changing I/O loads. This could cause slightly reduced performance when applications first begin to issue POSIX AIOs. When Should the Value of This Tunable Be Lowered? should be lowered when applications want to increase the speed with which the POSIX AIO thread pool adapts itself to I/O loads. This should generally maximize performance, except in the case of bursty I/O loads, or I/O loads with periodic peaks, for which a slower adapta- tion may be desirable. What Are the Side Effects of Lowering the Value of This Tunable? The POSIX AIO thread pool will adjust more quickly to changing I/O loads, so new threads will be spawned more quickly for new I/Os, and threads will be killed more quickly as I/O loads decrease. Except for bursty or periodic I/O loads, this should maximize performance. What Other Tunables Should Be Changed at the Same Time as This One? interacts with this tunable by setting a strict limit on the number of threads that can be used for POSIX AIO. interacts with this tunable by setting a limit on the number of threads that can be used for POSIX_AIO, but does so based on a percentage of the maximum number of allowable process threads. This allows the AIO thread pools to respond dynamically to changes in defines the desired relationship between the number of POSIX AIO kernel threads and the number of I/Os to be serviced. WARNINGS
All HP-UX kernel tunable parameters are release specific. This parameter may be removed or have its meaning changed in future releases of HP-UX. Installation of optional kernel software, from HP or other vendors, may cause changes to tunable parameter values. After installation, some tunable parameters may no longer be at the default or recommended values. For information about the effects of installation on tun- able values, consult the documentation for the kernel software being installed. For information about optional kernel software that was factory installed on your system, see at AUTHOR
was developed by HP. SEE ALSO
kctune(1M), sam(1M), gettune(2), settune(2), aio_proc_threads(5), aio_proc_thread_pct(5), aio_req_per_thread(5). Tunable Kernel Parameters aio_monitor_run_sec(5)
All times are GMT -4. The time now is 07:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy