Hello Monks
I am attempting to do remove duplicated lines from a comma delimited file. To the human eye the files appear the same but for some reason the uniq command doesn't see them as duplicates. I was hoping to be able to use perl to remove them.

Below is the file followed by the file after being run through od -ta

B1 name;B1 Bmk;B1 host;B1 arch;B1 mem;B1 dvr;B1 arw; SomeName;Blondie;server15;unix;1;1;32 SomeName;Blondie;server15;unix;2;2;43 SomeName;Blondie;server15;unix;3;3;54 SomeName;Blondie;server15;unix;4;4;65: B1 name;B1 Bmk;B1 host;B1 arch;B1 mem;B1 dvr;B1 arw; SomeName;Blondie;server12;unix;1;5;76 SomeName;Blondie;server12;unix;2;6;87 SomeName;Blondie;server12;unix;3;7;89 SomeName;Blondie;server12;unix;4;8;09;

0000000 B 1 sp n a m e ; B 1 sp B m k ; +B 0000020 1 sp h o s t ; B 1 sp a r c h ; +B 0000040 1 sp m e m ; B 1 sp d v r ; B 1 s +p 0000060 a r w ; nl S o m e N a m e ; B +l 0000100 o n d i e ; s e r v e r 1 5 ; +u 0000120 n i x ; 1 ; 1 ; 3 2 nl S o m e +N 0000140 a m e ; B l o n d i e ; s e r +v 0000160 e r 1 5 ; u n i x ; 2 ; 2 ; 4 +3 0000200 nl S o m e N a m e ; B l o n d +i 0000220 e ; s e r v e r 1 5 ; u n i x +; 0000240 3 ; 3 ; 5 4 nl S o m e N a m e +; 0000260 B l o n d i e ; s e r v e r 1 +5 0000300 ; u n i x ; 4 ; 4 ; 6 5 : nl B +1 0000320 sp n a m e ; B 1 sp B m k ; B 1 s +p 0000340 h o s t ; B 1 sp a r c h ; B 1 s +p 0000360 m e m ; B 1 sp d v r ; B 1 sp a +r 0000400 w ; nl S o m e N a m e ; B l o +n 0000420 d i e ; s e r v e r 1 2 ; u n +i 0000440 x ; 1 ; 5 ; 7 6 nl S o m e N a +m 0000460 e ; B l o n d i e ; s e r v e +r 0000500 1 2 ; u n i x ; 2 ; 6 ; 8 7 nl +S 0000520 o m e N a m e ; B l o n d i e +; 0000540 s e r v e r 1 2 ; u n i x ; 3 +; 0000560 7 ; 8 9 nl S o m e N a m e ; B +l 0000600 o n d i e ; s e r v e r 1 2 ; +u 0000620 n i x ; 4 ; 8 ; 0 9 ; nl 0000634

In reply to Removing Duplicate Lines from a File by johnirl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.