Search Results

Search: Posts Made By: spacegoose
5,601
Posted By spacegoose
With nezabudka's gawk I get: gawk...
With nezabudka's gawk I get:


gawk '{u[$0]; l++} ENDFILE {print length(u), l, FILENAME; delete u; l=0}' * | sort -k1,1n
4 6 file1
5 7 file2


With yours I get:


gawk '{l[$0]++} ENDFILE...
5,601
Posted By spacegoose
FYI - Just tried this, it printed correct counts...
FYI - Just tried this, it printed correct counts but unique counts were off. I will check the others and update.



Thanks nezabudka!! This seems to work with gawk -- thanks also vgersh99 for...
5,601
Posted By spacegoose
Print number of lines for files in directory, also print number of unique lines
I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with:

wc -l *|sort

15263 Image.txt
16401 reference.txt
40459 richtexteditor.txt...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 09:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy