![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| send email from address list and subject list | paulds | UNIX for Dummies Questions & Answers | 2 | 06-27-2008 10:11 AM |
| perl script to list filenames that do not contain given string | royalibrahim | Shell Programming and Scripting | 21 | 04-22-2008 01:55 PM |
| How to List and copy the files containing a string | redlotus72 | UNIX for Dummies Questions & Answers | 11 | 09-28-2007 11:58 AM |
| Search a string from list of input files | sivakumarvenkat | UNIX for Dummies Questions & Answers | 2 | 03-08-2006 06:08 PM |
| Extracting String from a list | odogbolu98 | Shell Programming and Scripting | 4 | 06-01-2002 02:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi there!
I have 150 txt files named chunk1, chunk2, ........., chunk150. I have a second file called string.txt with more than 1000 unique strings, house, dog, cat ... I want to know which command I should use to count how many times each string appears in the 150 files. I have tried with a grep -c dog chunk* but then I get the count of all of the files and I have to do it separately for each of the strings. The ideal solution would be an output saying: dog 45 cat 69 house 92 song 45 Thanks a lot in advance. Kind regards, Pep |
|
||||
|
Jim,
Thanks a lot for the quick answer but when running it I got the following error. awk: syntax error near line 3 awk: illegal statement near line 3 awk: syntax error near line 5 awk: bailing out near line 5 Do you know whether there is something wrong? Thanks Pep |
|
||||
|
Thanks a lot it is working now!
Kind regards, Pep |
| Sponsored Links | ||
|
|