Deleting a duplicate line

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

Deleting a duplicate line

Post by wlukasik » Thu Sep 20, 2007 12:22 pm

Roman,

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.

<Partition>
<Package>
<Document>
<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" />
</Document>
<!-- 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" />
</Package>
<!-- 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" />
</Partition>

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

Thanks much,

Walt

Abacre
Site Admin
Posts: 1201
Joined: Mon Jan 31, 2005 5:32 pm
Contact:

Re: Deleting a duplicate line

Post by Abacre » Tue Oct 09, 2007 9:41 pm

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
http://www.abacre.com
support@abacre.com

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

Re: Deleting a duplicate line

Post by wlukasik » Thu Oct 25, 2007 5:18 pm

Thanks Roman.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests