LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   shell script question: removing a line according to a duplicate "field" (http://www.linuxquestions.org/questions/linux-newbie-8/shell-script-question-removing-a-line-according-to-a-duplicate-field-402599/)

mattie_linux 01-12-2006 04:44 PM

shell script question: removing a line according to a duplicate "field"
 
Hi.

I am sorting my web logs with a shell script (they're not apache :( )
I want to only track unique visitors. So I have sorted my logs according to the first field, which is IP address.
Great. Now I want to throw out "duplicate" users. I need advice on how to do this. I know uniq will do this if *the whole line is the same.* But i want to throw a line out only if the first field/ column is the same. The rest of the line can be "unique."

thanks you,
Matt

pljvaldez 01-12-2006 04:57 PM

Try this one using awk:

http://servers.linux.com/article.pl?...&tid=42&tid=94


All times are GMT -5. The time now is 04:03 AM.