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 > unique wors

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-09-11, 19:21
Dworza Dworza is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
unique wors

Hello. I try to count the unique words in files in one folder and its subfolders.
I tried something like this :

ls| find -d | cat | tr "\ " "\n"| uniq -u | wc -l

but cat writes only the names of the files and not the text which is in them. :-S
Any idea, how to make it?
Reply With Quote
  #2 (permalink)  
Old 03-10-11, 10:39
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
try: "ls | find ... | xargs cat | ..."
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 03-10-11, 14:17
Dworza Dworza is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
Thank you, this was very helpful.
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