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