Deleting a duplicate line

General discussions about Advanced Find and Replace
Post Reply
Posts: 10
Joined: Mon Aug 13, 2007 3:36 pm

Deleting a duplicate line

Post by wlukasik »


Need your help again. Due to a bug in a purchased software package, there is a duplication in the following xml that is causing a failure.
Note how "<Attr name="TotalBlankPagesInsertedInPartition" value="0" />" is repeated within the last three lines of the "<!-- Partition Level Attributes -->" of the following xml.

<Attr name="CurrentDocumentInStream" value="1" />
<Attr name="CurrentDocumentInPartition" value="1" />
<Attr name="CurrentDocumentInPackage" value="1" />
<Attr name="IsLastDocumentOfPackage" value="true" />
<Attr name="TotalPagesInDocument" value="1" />
<Attr name="TotalRectoPagesInDocument" value="1" />
<Attr name="TotalVersoPagesInDocument" value="0" />
<Attr name="TotalBlankPagesInsertedInDocument" value="0" />
<Attr name="TotalSheetsInDocument" value="1" />
<Attr name="ASSSIGNED_TO" value="000PL3021" />
<Attr name="AUTH_UID" value="PL3021" />
<Attr name="Category" value="GC_FORMS" />
<Attr name="Creator_ID" value="3021" />
<Attr name="Curr_Date" value="June 22, 2007" />
<Attr name="GC_AUTHOR" value="Scott Gunn" />
<Attr name="GC_CLAIM_NO" value="2007-080009" />
<Attr name="InBound_Doc_Type" value="001218" />
<Attr name="Letter" value="Auto Payment Request Form" />
<Attr name="NJM_Random_GUID" value="ED6533A6713B976FA3F0E995B4E95C48" />
<Attr name="OutBound_Doc_Type" value="OUTBND_DOCTYP" />
<Attr name="POLICY_NO" value="F964535" />
<Attr name="Policy_Type" value="Personal Auto" />
<Attr name="PRINTER_ID" value="XP4250" />
<!-- Package Level Attributes -->
<Attr name="CurrentPackageInStream" value="1" />
<Attr name="CurrentPackageInPartition" value="1" />
<Attr name="TotalSheetsInPackage" value="1" />
<Attr name="TotalPackageWeight" value="0.0" />
<Attr name="TotalPackageThickness" value="0.0" />
<Attr name="TotalPagesInPackage" value="1" />
<Attr name="TotalRectoPagesInPackage" value="1" />
<Attr name="TotalVersoPagesInPackage" value="0" />
<Attr name="TotalBlankPagesInsertedInPackage" value="0" />
<!-- Partition Level Attributes -->
<Attr name="PartitionNO" value="1" />
<Attr name="TotalPagesInPartition" value="1" />
<Attr name="TotalRectoPagesInPartition" value="1" />
<Attr name="TotalVersoPagesInPartition" value="0" />
<Attr name="TotalBlankPagesInsertedInPartition" value="0" />
<Attr name="TotalSheetsInPartition" value="1" />
<Attr name="TotalBlankPagesInsertedInPartition" value="0" />

How do I delete one of the dups while retaining the other and the overall structure of the file?

Thanks much,


Site Admin
Posts: 1222
Joined: Mon Jan 31, 2005 5:32 pm

Re: Deleting a duplicate line

Post by Abacre »

Could you please explain what do you mean?
There are two possible cases:

1. You want to use AFR to find unknown duplicate lines. And delete one line.

2. You know which is the duplicate line and you want to delete one of the lines.
For example, you know that the line is:
<Attr name="TotalBlankPagesInsertedInPartition" value="0" />

The second case is quite simple.

Go to Replace tab.
Select Replace With action.

Put into Search For:
<Attr name="TotalSheetsInPartition" value="1" />
<Attr name="TotalBlankPagesInsertedInPartition" value="0" />

Replace with:
<Attr name="TotalSheetsInPartition" value="1" />

That's all. So you will delete only one instance of
<Attr name="TotalBlankPagesInsertedInPartition" value="0" />
Kind regards,
Abacre Limited

Posts: 10
Joined: Mon Aug 13, 2007 3:36 pm

Re: Deleting a duplicate line

Post by wlukasik »

Thanks Roman.

Post Reply