Mr. Shawn H. Corey wrote:
John W. Krahn wrote:
Mihir Kamdar wrote:
I want to remove duplicate records. But the record might not be entirely
duplicate. I only have to check if the 2nd, 3rd, 7th and 8th field of a
record is same as the earlier records. If it is same, then remove the
previous or the last entry. I have written something like below to achieve
this.

You don't need two loops for that, just one:

Two loops are required since the specification is to print the last entry (that's a duplicate) in the file, not the first.

Are you sure that "remove the previous or the last entry" translates into "print the last entry (that's a duplicate)"? Did you check with the OP on that?



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to