[PLUG] Counting Files
Robert Citek
robert.citek at gmail.com
Tue Aug 17 02:22:50 UTC 2021
On Mon, Aug 16, 2021 at 8:17 PM Michael Barnes <barnmichael at gmail.com>
wrote:
> Actually, they are callsigns instead of names. A couple of examples:
>
> W7ORE at K-0496-20210526.txt
> WA7SKG at K-0497-20210714.txt
> N8QBX at K-4386-20210725.txt
>
> I would like a simple count of the unique callsigns on a random basis and
> possibly an occasional report listing each callsign and how many files are
> in the folder for each.
>
> Michael
>
Here's a mock solution based on what Wes wrote:
$ mkdir Processed/
$ touch Processed/{foo@{01..10},bar@{05..20},dog@{10..30}}
$ ls Processed/
bar at 05 bar at 08 bar at 11 bar at 14 bar at 17 bar at 20 dog at 12 dog at 15 dog at 18
dog at 21 dog at 24 dog at 27 dog at 30 foo at 03 foo at 06 foo at 09
bar at 06 bar at 09 bar at 12 bar at 15 bar at 18 dog at 10 dog at 13 dog at 16 dog at 19
dog at 22 dog at 25 dog at 28 foo at 01 foo at 04 foo at 07 foo at 10
bar at 07 bar at 10 bar at 13 bar at 16 bar at 19 dog at 11 dog at 14 dog at 17 dog at 20
dog at 23 dog at 26 dog at 29 foo at 02 foo at 05 foo at 08
$ find Processed/ -type f | cut -d @ -f1 | sort | uniq -c
16 Processed/bar
21 Processed/dog
10 Processed/foo
Is that close to what you are looking for?
Regards,
- Robert
More information about the PLUG
mailing list