![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Remove duplicate text | dejavu88 | Shell Programming and Scripting | 7 | 06-08-2008 05:37 PM |
| Remove duplicate entry in one line | kharen11 | UNIX for Dummies Questions & Answers | 5 | 07-05-2007 03:56 PM |
| Remove duplicate | sabercats | Shell Programming and Scripting | 2 | 03-31-2006 01:35 PM |
| Remove duplicate ??? | sabercats | Shell Programming and Scripting | 3 | 03-10-2006 07:06 PM |
| remove duplicate | kazanoova2 | Shell Programming and Scripting | 4 | 04-12-2004 01:35 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Remove Duplicate line
Hi,
I have a scenario here where I have created a flatfile with the below mentioned information. File as you can see is dispalyed in three columns 1st column is FileNameString 2nd column is Report_Name (this has spaces) 3rd column is Flag Result file needed is, removal of duplicate Report_Name along with the entire line (which is FilenameString, Report_Name, Flag). When I try a sort -u, issue here is that sort reads from left to right hence I cannot just capture the duplicate Report_Name also tried this awk after searching through this archive. Here it compares second line to first line in the column (2) which is the Report_Name. Ofcourse with no results ![]() cat filename | awk -F"|" ' { A[$2] = $1} END {for ( j in A) print A[j], j } 19829.p3May05.58 ADJUST TRNS RPT NonNos 2315.001.p3May05.01 ADJUST TRNS RPT NonNos 6818.001.p3May05.04 ADJUST TRNS RPT NonNos 6852.p3May05.06 ADJUST TRNS RPT NonNos 1797.p2Apr05.36 EMPLEE EARN REC NonNos 1797.p2Apr05.36 EMPLEE EARN REC NonNos 283.p2Apr05.43 EMPLEE EARN REC NonNos 283.p2Apr05.43 EMPLEE EARN REC NonNos 7036.001.p2Apr05.57 WGPS VERIF RPT NonNos 7036.001.p2Apr05.57 WGPS VERIF RPT NonNos 7277.001.p2Apr05.08 WGPS VERIF RPT NonNos 69829.p3May05.58 ADJUST TRNS RPT NonNos 3315.001.p3May05.01 ADJUST TRNS RPT NonNos 9818.001.p3May05.04 ADJUST TRNS RPT NonNos Please let me know Ta |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|