KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a 40 MB csv file with 50,000 records. Its a giant product listing. Each row has close to 20 fields. [Item#, UPC, Desc, etc] How can I, a) Find and Print duplicate rows. [This file is a large appended file, so I have multiple headers included in the file which I need to remove, so I wanted to know exact rows which are duplicate first.] b) Find and Print duplicate rows based on a column. [See if a UPC is assigned to multiple products] I need to run the command or script on the server and I have Perl and Python installed. Even bash script or command will work for me too. I dont need to preserve the order of the rows. etc I tried, sort largefile.csv | uniq -d to get the duplicates, But I am not getting the expected answer. Ideally I would like bash script or command, but if any one has any other suggestion, that would be great too. Thanks See: Remove duplicate rows from a large file in Python over on Stack Overflow
Tags (comma-separated)
Save Edits
Cancel