Word frequency with additional information

Hello everyone,

I am using a chunk of code to display the frequency of a file name in a list of directories. The code looks like this:

find . -name "*.log" | cut -d/ -f4 | cut -d. -f1 | awk '{print $1}' | sort | uniq -c | sort -nr

The file paths would look something like this:

./clogs/20091201/2/205/54353.log
./clogs/20091201/12/201/99001.log
./clogs/20091202/2/205/54353.log
etc.

The 20091201 represents the date. Running the code would produce something like:

2  54353
1  99001

This is good but I'd like some extra information displayed as well. Specifically, the dates. Is it possible to add in the dates and have the output look like:

2 54353 20091201 20091202
1 99001 20091201

Any suggestions would be appreciated. Thanks.

This does what you asked for. But like Oscar Wilde said - the worst things are not getting what you asked for, but the worst is getting what you asked for.

This has the potential for VERY long lines in report.txt

find . -type f | awk -F'/'  '{ tmp=substr($NF, 1, index($NF,".")-1 ) 
                               dir[tmp]=dir[tmp] " " $2 
                               cnt[tmp]++
                             }
                        END {for (i in cnt) {print i, cnt, dir  } }' > report.txt

note: find . -type f gets files only, not any directories.