bash - Unique entry set in the first column of all csv files under directory -
this question has answer here:
- is there way 'uniq' column? 8 answers
i have list of comma separated files under directory. there no headers, , unfortunately not same length each row.
i want find unique entry in first column across files.
what's quickest way of doing in shell programming?
awk -f "," '{print $1}' *.txt | uniq
seems uniq entries of each files. want files.
shortest still using awk (this print row)
awk -f, '!a[$1]++' *.txt
to first field
awk -f, '!a[$1]++ {print $1}' *.txt
Comments
Post a Comment