<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl:  How to delete a paragraph fromtext file in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050528#M48614</link>
    <description>Thread Close</description>
    <pubDate>Mon, 04 Jun 2007 15:04:28 GMT</pubDate>
    <dc:creator>Junior C.</dc:creator>
    <dc:date>2007-06-04T15:04:28Z</dc:date>
    <item>
      <title>Perl:  How to delete a paragraph fromtext file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050523#M48609</link>
      <description>I'm looking for the syntax to delete a paragraph using perl.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;file.txt&lt;BR /&gt;&lt;BR /&gt;1. This forum is for discussing both general and technical issues regarding Linux OS.TXT distributions running on or utilizing Hewlett-Packard products. &lt;BR /&gt;&lt;BR /&gt;2. forum is for discussing both general and technical issues regarding Linux OS distributions running on or utilizing Hewlett-Packard products. &lt;BR /&gt;&lt;BR /&gt;3.  The forum is for discussing both general and technical issues regarding Linux OS distributions running on or utilizing Hewlett-Packard products.TXT&lt;BR /&gt;&lt;BR /&gt;If any line contain .TXT I want to delete that paragraph and print the remaining paragraph to newfile.txt &lt;BR /&gt;&lt;BR /&gt;from above newfile.txt should only have (prag 2.)&lt;BR /&gt;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;  print unless m/\b.TXT/i;&lt;BR /&gt;&lt;BR /&gt;not working.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-JC.&lt;BR /&gt;</description>
      <pubDate>Fri, 01 Jun 2007 10:54:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050523#M48609</guid>
      <dc:creator>Junior C.</dc:creator>
      <dc:date>2007-06-01T10:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: Perl:  How to delete a paragraph fromtext file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050524#M48610</link>
      <description>Hi JC:&lt;BR /&gt;&lt;BR /&gt;# perl -nle 'BEGIN{$/=""};next if m{\.TXT};print' file&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 01 Jun 2007 15:08:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050524#M48610</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-01T15:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Perl:  How to delete a paragraph fromtext file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050525#M48611</link>
      <description>James,&lt;BR /&gt;&lt;BR /&gt;      Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;I'm not sure how do I open/read the file, and then apply     perl -nle 'BEGIN{$/=""};next if m{\.TXT};print' file&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;-JC.&lt;BR /&gt;</description>
      <pubDate>Fri, 01 Jun 2007 15:41:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050525#M48611</guid>
      <dc:creator>Junior C.</dc:creator>
      <dc:date>2007-06-01T15:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Perl:  How to delete a paragraph fromtext file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050526#M48612</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;may be this script can solve your problem?&lt;BR /&gt;&lt;BR /&gt;----file.pl----&lt;BR /&gt;#!/usr/bin/perl -w&lt;BR /&gt;open (LIST,"file.txt") || die "where is file?\n";&lt;BR /&gt;$^I = '';&lt;BR /&gt;$/  = '';&lt;BR /&gt;while (&lt;LIST&gt;) {&lt;BR /&gt;        next if /^.*\.TXT.*\n/;&lt;BR /&gt;        print;&lt;BR /&gt;}&lt;BR /&gt;close (LIST);&lt;BR /&gt;--------------&lt;BR /&gt;&lt;BR /&gt;# ./file.pl &amp;gt; newfile.txt&lt;BR /&gt;&lt;BR /&gt;BR&lt;BR /&gt;Sergejs&lt;/LIST&gt;</description>
      <pubDate>Fri, 01 Jun 2007 15:51:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050526#M48612</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2007-06-01T15:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Perl:  How to delete a paragraph fromtext file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050527#M48613</link>
      <description>Hi (again) JC:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I'm not sure how do I open/read the file, and then apply perl -nle 'BEGIN{$/=""};next if m{\.TXT};print' file&lt;BR /&gt;&lt;BR /&gt;Well, my command-line script did it all for you.  Adding your requirement for case-insensitive matching and a boundry (\b):&lt;BR /&gt;&lt;BR /&gt;# perl -nle 'BEGIN{$/=""};next if m{\b\.TXT}i;print' file&lt;BR /&gt;&lt;BR /&gt;Simply paste the line above and substitute the name of your 'file' for 'file', or drop the 'file' argument and pipe an output stream to Perl.&lt;BR /&gt;&lt;BR /&gt;Notice that a "." signifies any character unless escaped.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 02 Jun 2007 10:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050527#M48613</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-06-02T10:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Perl:  How to delete a paragraph fromtext file</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050528#M48614</link>
      <description>Thread Close</description>
      <pubDate>Mon, 04 Jun 2007 15:04:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-how-to-delete-a-paragraph-fromtext-file/m-p/5050528#M48614</guid>
      <dc:creator>Junior C.</dc:creator>
      <dc:date>2007-06-04T15:04:28Z</dc:date>
    </item>
  </channel>
</rss>

