The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Remove Similar Lines from a File
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Remove Similar Lines from a File
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
4
(
permalink
)
09-04-2007
Nysif Steve
Registered User
Join Date: Aug 2007
Location: Albany, NY
Posts: 26
I ended up using the code:
Code:
cat logfile | sort | uniq -c -n6 >> logreport
For the uniq command the -c flag will print the number of occurences before each line while the -n6 flag will ignore the first 6 fields for comparison. The end result is exactly what I needed. Thank you for your help everyone.
Nysif Steve
View Public Profile
Find all posts by Nysif Steve
Find Nysif Steve's past nominations received
Find Nysif Steve's present nominations given