![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| removing duplicates of a pattern from a file | ashisharora | UNIX for Dummies Questions & Answers | 3 | 09-04-2008 07:25 AM |
| removing duplicates | stevie_velvet | Shell Programming and Scripting | 5 | 07-07-2008 08:42 AM |
| Removing duplicates in a sorted file by field. | kinksville | Shell Programming and Scripting | 1 | 04-29-2008 03:03 PM |
| removing duplicates from a file | trichyselva | UNIX for Dummies Questions & Answers | 2 | 03-25-2008 10:49 AM |
| Removing duplicates | giannicello | Shell Programming and Scripting | 12 | 09-14-2005 07:12 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Removing duplicates from log file?
I have a log file with posts looking like this: [arrival time]-[message]-[id number] Messages can be delivered by different systems at different times. The id number is used to sort out duplicate messages. What I need is to strip the arrival time from each post, sort posts by id number, and reattach arrival time to respective post. Raw data: Code:
200901211501-hello1-010 200901211504-hello1-010 200901211507-hello2-052 200901211512-hello2-052 200901211522-hello3-713 200901211544-hello4-220 200901211559-hello5-117 200901211612-hello5-117 200901211630-hello5-117 This is what I want to achieve (dupes removed): Code:
200901211501-hello1-010 200901211507-hello2-052 200901211522-hello3-713 200901211544-hello4-220 200901211559-hello5-117 I've used different combinations of sed and uniq, but I seem to fail. Grateful for any help. |
| Bookmarks |
| Tags |
| remove duplicates |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|