in reply to Re: Reading file and matching lines
in thread Reading file and matching lines
I complete forgot about that thread, thank you for reminding me.
I do however have a quick question... if I want to check for duplicate G entries within the same scope (i.e between E and h records) how would I do it.I have some example code I tried but it just prints all G records.
here is the example data I'm usingmy $lines if(/^G/) { next if ($lines eq $_); $lines = $_; print $_; }
E123456789 G123456798 ignore this as this is the first instance of G record +in scope h12345 E1234567 E7899874 G123456798 even though this is the same ignore as its first insta +nce G123456789 ignore this as it is different from previous G record G123465798 should flag duplicate here because it is the same firs +t G record in scope!!! h1245
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Reading file and matching lines
by kcott (Archbishop) on Feb 14, 2014 at 00:33 UTC |