The UNIX and Linux Forums  

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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can you delete records in a file matching a pattern? mode09 UNIX for Dummies Questions & Answers 2 07-15-2008 02:53 PM
Pattern matching for file doitnow Shell Programming and Scripting 0 06-20-2008 08:02 AM
Reading lines in a file matching a pattern torenji Shell Programming and Scripting 4 10-25-2007 05:15 AM
getting file words as pattern matching arunkumar_mca High Level Programming 5 05-31-2005 04:28 AM
pattern matching and print with sed nymus7 Shell Programming and Scripting 2 04-14-2005 10:36 AM

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

Join Date: Oct 2007
Posts: 35
Pattern matching in Duplicated file and print once

Dear Experts,

I have many alarms appeared in a file twice, i want to grep them with this info EVTTIME & DOMAIN, and print them in second file with 1 occurance.


I have tried uniq -d test.txt > newfile and awk '!arr[$0]++' test.txt > newfile both are not working


Please help me with this!!!


For example i want to grep this info to filter out 1 message:
EVTTIME="2008/07/04 17:54:48"OMAIN="alcomc2_BSS_67"


EVTTYPE="EQUIPMENT":SEV="MAJOR":FRDNAME="MGH689E__MGWMGH_1 HWY3756__H_KauChwkSarwrShahed_1 tre 6":SPECPB="172181 , RX-TX [10] HW-FAILURE [239]":EVTTIME="2008/07/04 17:54:48"OMAIN="alcomc2_BSS_67":ADDTEXT="Object-Class % SBL
Object-Instance %

EVTTYPE="EQUIPMENT":SEV="MAJOR":FRDNAME="MGH689E__MGWMGH_1 HWY3756__H_KauChwkSarwrShahed_1 tre 6":SPECPB="172181 , RX-TX [10] HW-FAILURE [239]":EVTTIME="2008/07/04 17:54:48"OMAIN="alcomc2_BSS_67":ADDTEXT="Object-Class % SBL
Object-Instance %



Thanks and Best Regards,
  #2 (permalink)  
Old 08-01-2008
Danish Shakil Danish Shakil is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 35
Duplicated string in a file

Sorry its not duplicated file, instead its a duplicated string in a file.
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 07:01 PM.


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