Skip to content
Advertisement

finding unique values in a data file

I can do this in python but I was wondering if I could do this in Linux

I have a file like this

JavaScript

I want to find all the different types of values in the 3rd column by a particular username lets say name 1.

grep name1 filename gives me all the lines, but there must be some way to just list all the different type of values? (I don’t want to display duplicate values for the same username)

Advertisement

Answer

JavaScript

This will find all lines that have name1, then get just the fourth column of data and show only unique values.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement