Sponsored Content
Top Forums Shell Programming and Scripting Counting words from one file in another file Post 302492254 by Chubler_XL on Sunday 30th of January 2011 06:23:04 PM
Old 01-30-2011
How about something like this:

Code:
for DIC in *.dic
do
    FIL=$(basename "$DIC" .dic).fil
    ls *.dat | awk '
       NR==FNR {dic[$1]=r++; cnt[r]=0; next}
       { FILE=$0
         while((getline < FILE))
             if($1 in dic && !($1 in fnd)) {
                 fnd[$1]++;
                 cnt[dic[$1]]++;
             }
         delete fnd
       }
       END {for(i=0;i<r;i++) print cnt[i]}' $DIC - > $FIL
done

This User Gave Thanks to Chubler_XL For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Counting words in a file

I'm trying to figure out a way to count the number of words in the follwing file: cal 2002 > file1 Is there anyway to do this without using wc but instead using the cut command? (1 Reply)
Discussion started by: r0mulus
1 Replies

2. UNIX for Dummies Questions & Answers

counting words then amending to a file

i want to count the number of words in a file and then redirect this to a file echo 'total number of words=' wc -users>file THis isnt working, anyone any ideas. (1 Reply)
Discussion started by: iago
1 Replies

3. UNIX for Dummies Questions & Answers

counting words

if i have a long list of data, with every line beginning with an ip-address, like this: 62.165.8.187 - - "GET /bestandnaam.html HTTP/1.1" 200 5848 "http://www.domeinnaam.nl/bestandnaam.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" how do i count which ip-adresses are mentioned... (3 Replies)
Discussion started by: FOBoy
3 Replies

4. Shell Programming and Scripting

Counting words

Hi Is there a way to count the no. of words in all files in directory. All are text files.I use wc -w but somehow i am not getting the rite answer. Is there an alternative. Thanks in advance (9 Replies)
Discussion started by: kinny
9 Replies

5. Programming

Counting the words in a file

Please find the below program. It contains the purpose of the program itself. /* Program : Write a program to count the number of words in a given text file */ /* Date : 12-June-2010 */ # include <stdio.h> # include <stdlib.h> # include <string.h> int main( int argc, char *argv ) {... (6 Replies)
Discussion started by: ramkrix
6 Replies

6. Shell Programming and Scripting

Help in counting the no of repeated words with count in a file

Hi Pls help in solving my doubt.Iam having file like below file1.txt priya jenny jenny priya raj radhika priya bharti bharti Output required: I need a output like count of repeated words with name for ex: priya 3 jenny 2 (4 Replies)
Discussion started by: bha148
4 Replies

7. Shell Programming and Scripting

Counting number of files that contain words stored in another file

Hi All, I have written a script on this but it does not do the requisite job. My requirement is this: 1. I have two kinds of files each with different extensions. One set of files are *.dat (6000 unique DAT files all in one directory) and another set *.dic files (6000 unique DIC files in... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

8. Shell Programming and Scripting

Splitting Concatenated Words in Input File with Words from a Master File

Hello, I have a complex problem. I have a file in which words have been joined together: Theboy ranslowly I want to be able to correctly split the words using a lookup file in which all the words occur: the boy ran slowly slow put child ly The lookup file which is meant for look up... (21 Replies)
Discussion started by: gimley
21 Replies

9. Shell Programming and Scripting

Counting occurrence of all words in a file

Hi, Given below is the input file: http://i53.tinypic.com/2vmvzb8.png Given below is what the output file should look like: http://i53.tinypic.com/1e6lfq.png I know how to count the occurrence of 1 word from a file, but not all of them. Can someone help please? An explanation on the... (1 Reply)
Discussion started by: r4v3n
1 Replies

10. Shell Programming and Scripting

Splitting concatenated words in input file with words from the same file

Dear all, I am working with names and I have a large file of names in which some words are written together (upto 4 or 5) and their corresponding single forms are also present in the word-list. An example would make this clear annamarie mariechristine johnsmith johnjoseph smith john smith... (8 Replies)
Discussion started by: gimley
8 Replies
DateTime::Locale::it_IT(3)				User Contributed Perl Documentation				DateTime::Locale::it_IT(3)

NAME
DateTime::Locale::it_IT SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'it_IT' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Italian Italy. DATA
This locale inherits from the DateTime::Locale::it locale. It contains the following data. Days Wide (format) lunedi martedi mercoledi giovedi venerdi sabato domenica Abbreviated (format) lun mar mer gio ven sab dom Narrow (format) L M M G V S D Wide (stand-alone) Lunedi Martedi Mercoledi Giovedi Venerdi Sabato Domenica Abbreviated (stand-alone) lun mar mer gio ven sab dom Narrow (stand-alone) L M M G V S D Months Wide (format) gennaio febbraio marzo aprile maggio giugno luglio agosto settembre ottobre novembre dicembre Abbreviated (format) gen feb mar apr mag giu lug ago set ott nov dic Narrow (format) G F M A M G L A S O N D Wide (stand-alone) Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre Abbreviated (stand-alone) gen feb mar apr mag giu lug ago set ott nov dic Narrow (stand-alone) G F M A M G L A S O N D Quarters Wide (format) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (format) T1 T2 T3 T4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1o trimestre 2o trimestre 3o trimestre 4o trimestre Abbreviated (stand-alone) T1 T2 T3 T4 Narrow (stand-alone) 1 2 3 4 Eras Wide a.C. d.C Abbreviated aC dC Narrow aC dC Date Formats Full 2008-02-05T18:30:30 = martedi 5 febbraio 2008 1995-12-22T09:05:02 = venerdi 22 dicembre 1995 -0010-09-15T04:44:23 = sabato 15 settembre -10 Long 2008-02-05T18:30:30 = 05 febbraio 2008 1995-12-22T09:05:02 = 22 dicembre 1995 -0010-09-15T04:44:23 = 15 settembre -10 Medium 2008-02-05T18:30:30 = 05/feb/2008 1995-12-22T09:05:02 = 22/dic/1995 -0010-09-15T04:44:23 = 15/set/-10 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 Default 2008-02-05T18:30:30 = 05/feb/2008 1995-12-22T09:05:02 = 22/dic/1995 -0010-09-15T04:44:23 = 15/set/-10 Time Formats Full 2008-02-05T18:30:30 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Long 2008-02-05T18:30:30 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Medium 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Short 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 Default 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Datetime Formats Full 2008-02-05T18:30:30 = martedi 5 febbraio 2008 18.30.30 UTC 1995-12-22T09:05:02 = venerdi 22 dicembre 1995 09.05.02 UTC -0010-09-15T04:44:23 = sabato 15 settembre -10 04.44.23 UTC Long 2008-02-05T18:30:30 = 05 febbraio 2008 18.30.30 UTC 1995-12-22T09:05:02 = 22 dicembre 1995 09.05.02 UTC -0010-09-15T04:44:23 = 15 settembre -10 04.44.23 UTC Medium 2008-02-05T18:30:30 = 05/feb/2008 18.30.30 1995-12-22T09:05:02 = 22/dic/1995 09.05.02 -0010-09-15T04:44:23 = 15/set/-10 04.44.23 Short 2008-02-05T18:30:30 = 05/02/08 18.30 1995-12-22T09:05:02 = 22/12/95 09.05 -0010-09-15T04:44:23 = 15/09/-10 04.44 Default 2008-02-05T18:30:30 = 05/feb/2008 18.30.30 1995-12-22T09:05:02 = 22/dic/1995 09.05.02 -0010-09-15T04:44:23 = 15/set/-10 04.44.23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 mar 1995-12-22T09:05:02 = 22 ven -0010-09-15T04:44:23 = 15 sab HHmm (HH.mm) 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 hhmm (hh.mm a) 2008-02-05T18:30:30 = 06.30 p. 1995-12-22T09:05:02 = 09.05 m. -0010-09-15T04:44:23 = 04.44 m. HHmmss (HH.mm.ss) 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 hhmmss (hh.mm.ss a) 2008-02-05T18:30:30 = 06.30.30 p. 1995-12-22T09:05:02 = 09.05.02 m. -0010-09-15T04:44:23 = 04.44.23 m. Hm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 p. 1995-12-22T09:05:02 = 9:05 m. -0010-09-15T04:44:23 = 4:44 m. Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 p. 1995-12-22T09:05:02 = 9:05:02 m. -0010-09-15T04:44:23 = 4:44:23 m. M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MEd (EEE d/M) 2008-02-05T18:30:30 = mar 5/2 1995-12-22T09:05:02 = ven 22/12 -0010-09-15T04:44:23 = sab 15/9 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = feb 1995-12-22T09:05:02 = dic -0010-09-15T04:44:23 = set MMMd (d MMM) 2008-02-05T18:30:30 = 5 feb 1995-12-22T09:05:02 = 22 dic -0010-09-15T04:44:23 = 15 set MMMEd (EEE d MMM) 2008-02-05T18:30:30 = mar 5 feb 1995-12-22T09:05:02 = ven 22 dic -0010-09-15T04:44:23 = sab 15 set MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 febbraio 1995-12-22T09:05:02 = 22 dicembre -0010-09-15T04:44:23 = 15 settembre MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 febbraio 1995-12-22T09:05:02 = 22 dicembre -0010-09-15T04:44:23 = 15 settembre MMMMEd (EEE d MMMM) 2008-02-05T18:30:30 = mar 5 febbraio 1995-12-22T09:05:02 = ven 22 dicembre -0010-09-15T04:44:23 = sab 15 settembre ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (M/yyyy) 2008-02-05T18:30:30 = 2/2008 1995-12-22T09:05:02 = 12/1995 -0010-09-15T04:44:23 = 9/-010 yMEd (EEE, d-M-yyyy) 2008-02-05T18:30:30 = mar, 5-2-2008 1995-12-22T09:05:02 = ven, 22-12-1995 -0010-09-15T04:44:23 = sab, 15-9--010 yMMM (MMM y) 2008-02-05T18:30:30 = feb 2008 1995-12-22T09:05:02 = dic 1995 -0010-09-15T04:44:23 = set -10 yMMMEd (EEE d MMM y) 2008-02-05T18:30:30 = mar 5 feb 2008 1995-12-22T09:05:02 = ven 22 dic 1995 -0010-09-15T04:44:23 = sab 15 set -10 yMMMM (MMMM y) 2008-02-05T18:30:30 = febbraio 2008 1995-12-22T09:05:02 = dicembre 1995 -0010-09-15T04:44:23 = settembre -10 yQ (Q-yyyy) 2008-02-05T18:30:30 = 1-2008 1995-12-22T09:05:02 = 4-1995 -0010-09-15T04:44:23 = 3--010 yQQQ (QQQ y) 2008-02-05T18:30:30 = T1 2008 1995-12-22T09:05:02 = T4 1995 -0010-09-15T04:44:23 = T3 -10 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyQQQQ (QQQQ yy) 2008-02-05T18:30:30 = 1o trimestre 08 1995-12-22T09:05:02 = 4o trimestre 95 -0010-09-15T04:44:23 = 3o trimestre -10 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = febbraio 2008 1995-12-22T09:05:02 = dicembre 1995 -0010-09-15T04:44:23 = settembre -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week lunedi SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::it_IT(3)
All times are GMT -4. The time now is 12:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy