Return a List of Counted, Unique Items
excel, r
Solution
If I understand correctly, this should work (in R):
# Emulate your file
cat('A,B,C,D\nB,D\nA,A,F,Q,F\n', file='foo.csv')
x <- scan('foo.csv', what='', sep=',')
table(x)
#x
#A B C D F Q
#3 2 1 2 2 1
Problem
I've been given a file with hundreds of thousands of values, inconsistently formatted in a .CSV file. Structure might resemble: A,B,C,D E,F G,H,I,J,K,L,M,N,O P,Q,R,S And so on. All that I need to do is to a) list the unique values and b) count instances of same. Happy to do this in R, Excel or any other tool recommended. Normally, I'd use something like Google Docs' =UNIQUE and =COUNT functions, but the spreadsheet is too big to load there. Nor have I found exact equivalents in Excel, oddly enough. Any help appreciated.