You could do this at the prompt with something like
perl -ne 'print if / (\S) \1 \1$/' data.txt
assuming your file is named data.txt. If you want to save that to a second file then
perl -ne 'print if / (\S) \1 \1$/' data.txt > second.file

The -ne flags are very handy at the command line. The -e flag means "evaluate this code". The -n flag doesn't have a convenient mnemonic but wraps a loop around the code for every line of input.

For example...

perl -e 'print "hello world\n"'

... is a nice canonical example. And...

perl -ne 'print "hello world. Look at this: $_"' data.txt

...will prepend text to every line of data.txt and print the result.

more docs for command line options at perlrun

more docs for regular expressions at perlre


In reply to Re: ignore some delimiters while using split by perlpie
in thread ignore some delimiters while using split by nurulnad

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.