The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
deleting double entries in a log file opusforum Shell Programming and Scripting 7 03-13-2009 04:42 AM
Remove Similar Lines from a File Nysif Steve Shell Programming and Scripting 4 03-13-2009 03:49 AM
Need Help: Collecting similar messages in a file ashish.kapil Shell Programming and Scripting 2 01-16-2008 06:57 AM
replace a similar field in a file chiru_h Shell Programming and Scripting 2 11-01-2006 05:23 PM
cuting the entries from one file and copy to other vasikaran UNIX for Dummies Questions & Answers 0 08-03-2005 08:22 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-30-2007
Nysif Steve Nysif Steve is offline
Registered User
  
 

Join Date: Aug 2007
Location: Albany, NY
Posts: 26
Remove Similar entries in a File

--------------------------------------------------------------------------------

I have a log file "logreport" that contains several lines as seen below:


04:20:00 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping
06:38:08 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping
07:11:05 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping


I would like to edit the report to remove entries that report duplicate events. I am trying to produce an output close to what is seen below:


04:20:00 /usr/lib/snmp/snmpdx: [ID 702911 daemon.error] Agent snmpd appeared dead but responded to ping
This Error was reproduced 2 times
  #2 (permalink)  
Old 08-30-2007
kamitsin's Avatar
kamitsin kamitsin is offline
Registered User
  
 

Join Date: Nov 2006
Location: /dev/null
Posts: 177
Forum rules - no duplicate posts !!!
  #3 (permalink)  
Old 03-13-2009
uniesh uniesh is offline
Banned
  
 

Join Date: Mar 2009
Posts: 16
cat file1|sort|uniq -c | cut -f2
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:13 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0