You've got the right idea...
for i in *.cvs
do
cut -f3 -d"," $i
done | sort | uniq
This gives you a unique list of all the items in column 3 in all of the .cvs files in the current directory, assuming that you file delimiters are commas ",".
I just realized - this should also work:
cat *.cvs | cut -f3 -d"," | sort | uniq
As well this should work too:
cut -f3 -d"," *.cvs | sort | uniq
-- note: the uniq command (filters for uniqueness) doesn't work with unsorted data, thus the sort command in front of it.
Hope that these options help get you along in your task,
this should give you the list of all stations in all of the files that have reported/recorded data in this dump set of .cvs files.
Last edited by Lnthink; 04-14-2015 at 04:35 PM.
|