I have csv file with almost 300k records. It looks like this
Id, Name, City
1 Alex New York
2 Alex Florida
3 John New York
...
300k Alex New York
Well, I need to parse it and create 2 separate files with 500 most frequent columns(name and city). For example, in 300k records, I have 20k Alex(name), 1k John(name), 25k Fred(name) and make separate csv file with 500 most frequent names descendingly
Id, Name
1. Fred
2. Alex
3. John
The same with the cities How to do it best?