Filter unique values from col1 and print the dataset using unix_large dataset
I have a large dataset more than >6L rows. In Col1, I have some duplicates in Col1 and want to remove the duplicates and their values present in corresponding rows as well. How to do in unix commands ?
• 535 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hi sofie_carolina, I'm sure you can find your answer on StackOverflow. Just remember to present your input data and expected output.
Hello sofie_carolina!
We believe that this post does not fit the main topic of this site.
More suitable at StackOverflow, see below related SO posts:
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!
To filter out rows based on value in Col1 do
awk '!x[$1]++' < YOURFILEthe$1being the first column (not the column name). Beware that$0checks if whole row is unique. So if you want to filter based on second column you would writeawk '!x[$2]++' < YOURFILE.See
man awkfor more information.Thanks a ton! Gentleman