Re: [PLUG] Counting Files

2021-08-19 Thread Michael Barnes
On Mon, Aug 16, 2021 at 7:25 PM wes wrote: > To get the count of unique callsigns, you can just feed this same command > into wc -l. > > find Processed -type f -printf '%f\n' | sed "s/@.*//" | uniq -c | wc -l > > -wes > > > On Mon, Aug 16, 2021 at 7:21 PM wes wrote: > > > if the @ is consistent

Re: [PLUG] Counting Files

2021-08-17 Thread David Fleck
Ugh. Sorry, too little coffee. Didn't notice this had already been covered. --- David Fleck ‐‐‐ Original Message ‐‐‐ On Tuesday, August 17th, 2021 at 7:39 AM, David Fleck wrote: > 'cut' might work well also. > > > ls | cut -f1 -d@ | sort | uniq -c > > to get a list in sort order, or

Re: [PLUG] Counting Files

2021-08-17 Thread David Fleck
'cut' might work well also. > ls | cut -f1 -d@ | sort | uniq -c to get a list in sort order, or > ls | cut -f1 -d@ |sort | uniq -c | sort -n to get a list ordered by frequency. --- David Fleck ‐‐‐ Original Message ‐‐‐ On Tuesday, August 17th, 2021 at 1:46 AM, Russell Senior wrote:

Re: [PLUG] Counting Files

2021-08-17 Thread Randy Bush
>> can you point me to where it is documented that `find` is guaranteed >> to produce an ordered list? > I don't have any such documentation or belief. my belief is that uniq > will count non-consecutive matches it won't randy

Re: [PLUG] Counting Files

2021-08-17 Thread Russell Senior
>From the uniq manpage: Note: 'uniq' does not detect repeated lines unless they are adjacent. You may want to sort the input first, or use 'sort -u' without 'uniq'. Also, comparisons honor the rules specified by 'LC_COLLATE'. On Mon, Aug 16, 2021 at 10:45 PM wes wrote: > > On Mon, Aug 16,

Re: [PLUG] Counting Files

2021-08-16 Thread wes
On Mon, Aug 16, 2021 at 8:45 PM Randy Bush wrote: > > can you point me to where it is documented that `find` is guaranteed > to produce an ordered list? > I don't have any such documentation or belief. my belief is that uniq will count non-consecutive matches, that's what I'm relying on.

Re: [PLUG] Counting Files

2021-08-16 Thread David Fleck
As Wes said, an example or two would help greatly. --- David Fleck ‐‐‐ Original Message ‐‐‐ On Monday, August 16th, 2021 at 7:17 PM, wes wrote: > are firstnames and lastnames always separated by the same character in each > > filename? > > are the names separated from the rest of the

Re: [PLUG] Counting Files

2021-08-16 Thread Randy Bush
> find Processed -type f -printf '%f\n' | sed "s/@.*//" | uniq -c can you point me to where it is documented that `find` is guaranteed to produce an ordered list? yes, it seems to often do so, but i have learned not to trust it. so i would ... | sort | uniq -c woulda been cool to use

Re: [PLUG] Counting Files

2021-08-16 Thread wes
To get the count of unique callsigns, you can just feed this same command into wc -l. find Processed -type f -printf '%f\n' | sed "s/@.*//" | uniq -c | wc -l -wes On Mon, Aug 16, 2021 at 7:21 PM wes wrote: > if the @ is consistent with all the files, that makes it relatively easy. > > find

Re: [PLUG] Counting Files

2021-08-16 Thread wes
if the @ is consistent with all the files, that makes it relatively easy. find Processed -type f -printf '%f\n' | sed "s/@.*//" | uniq -c -wes On Mon, Aug 16, 2021 at 7:17 PM Michael Barnes wrote: > On Mon, Aug 16, 2021 at 5:29 PM David Fleck wrote: > > > As Wes said, an example or two would

Re: [PLUG] Counting Files

2021-08-16 Thread Robert Citek
On Mon, Aug 16, 2021 at 8:17 PM Michael Barnes wrote: > Actually, they are callsigns instead of names. A couple of examples: > > w7...@k-0496-20210526.txt > wa7...@k-0497-20210714.txt > n8...@k-4386-20210725.txt > > I would like a simple count of the unique callsigns on a random basis and >

Re: [PLUG] Counting Files

2021-08-16 Thread Michael Barnes
On Mon, Aug 16, 2021 at 5:29 PM David Fleck wrote: > As Wes said, an example or two would help greatly. > > --- David Fleck > > ‐‐‐ Original Message ‐‐‐ > > On Monday, August 16th, 2021 at 7:17 PM, wes wrote: > > > are firstnames and lastnames always separated by the same character in >

Re: [PLUG] Counting Files

2021-08-16 Thread wes
are firstnames and lastnames always separated by the same character in each filename? are the names separated from the rest of the info in the filename the same way for each file? are you doing this once, or will this be a repeating task that would be handy to automate? would you be able to

[PLUG] Counting Files

2021-08-16 Thread Michael Barnes
Here's a fun trivia task. For an activity I am involved in, I get files from members to process. The filename starts with the member's name and has other info to identify the file. After processing, the file goes in the ./Processed folder. There are thousands of files now in that folder. Right