The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 04-24-2008
karthikn7974's Avatar
karthikn7974 karthikn7974 is offline VIP Member  
Supporter
  
 

Join Date: Jul 2007
Location: Singapore
Posts: 58
Lightbulb Remove duplicate lines in log files

Hi
Having a file as follows

Code:
==================================================
Date           Time         error code      server 
======================================================
12-29-08    10:10        121221          server A
12-29-08    10:12        121221          server A
12-29-08    10:10        121221          server B
12-29-08    10:10        121221          server B

need to remove the duplicate lines with the following conditions

if date=12-29-08 and server=server A .
Must delete the line with old time and keep the latest.

Found similiar post in this forum but dont know how to use with my condition.

anyone can suggest

Thanks in advance