<?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: Formatting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768603#M74121</link>
    <description>Hi,&lt;BR /&gt;Assuming you want not only delete the lines between START and END, but also START and END themselves, you can use the following:&lt;BR /&gt;&lt;BR /&gt;awk '{if ($1=="START") del=1;&lt;BR /&gt;      if (del!=1) print $0;&lt;BR /&gt;      if ($1=="END") del=0;&lt;BR /&gt;}' DATAFILE&lt;BR /&gt;&lt;BR /&gt;In case you want to leave the START-END lines itselve, you should use:&lt;BR /&gt;&lt;BR /&gt;awk '{ if ($1=="END") del=0;&lt;BR /&gt;       if (del!=1) print $0;&lt;BR /&gt;       if ($1=="START") del=1;&lt;BR /&gt;}' DATAFILE&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ceesjan</description>
    <pubDate>Sun, 21 Jul 2002 21:06:53 GMT</pubDate>
    <dc:creator>Ceesjan van Hattum</dc:creator>
    <dc:date>2002-07-21T21:06:53Z</dc:date>
    <item>
      <title>Formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768602#M74120</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a text data file. I want to delete part of the file contents. Anything between START and END I want to delete.&lt;BR /&gt;&lt;BR /&gt;EX:&lt;BR /&gt;&lt;BR /&gt;line1&lt;BR /&gt;line2&lt;BR /&gt;START&lt;BR /&gt;line3&lt;BR /&gt;-&lt;BR /&gt;-&lt;BR /&gt;Line7&lt;BR /&gt;END&lt;BR /&gt;some lines&lt;BR /&gt;START&lt;BR /&gt;some lines&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Sun, 21 Jul 2002 20:48:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768602#M74120</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2002-07-21T20:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768603#M74121</link>
      <description>Hi,&lt;BR /&gt;Assuming you want not only delete the lines between START and END, but also START and END themselves, you can use the following:&lt;BR /&gt;&lt;BR /&gt;awk '{if ($1=="START") del=1;&lt;BR /&gt;      if (del!=1) print $0;&lt;BR /&gt;      if ($1=="END") del=0;&lt;BR /&gt;}' DATAFILE&lt;BR /&gt;&lt;BR /&gt;In case you want to leave the START-END lines itselve, you should use:&lt;BR /&gt;&lt;BR /&gt;awk '{ if ($1=="END") del=0;&lt;BR /&gt;       if (del!=1) print $0;&lt;BR /&gt;       if ($1=="START") del=1;&lt;BR /&gt;}' DATAFILE&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ceesjan</description>
      <pubDate>Sun, 21 Jul 2002 21:06:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768603#M74121</guid>
      <dc:creator>Ceesjan van Hattum</dc:creator>
      <dc:date>2002-07-21T21:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768604#M74122</link>
      <description>hi , &lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;check=0&lt;BR /&gt;&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;  if [ "$line" = "START" ]&lt;BR /&gt;  then &lt;BR /&gt;      check=1&lt;BR /&gt;  elif [ "$line" = "END" ]&lt;BR /&gt;  then check=0&lt;BR /&gt;  elif [ $check -eq 0 ]&lt;BR /&gt;  then &lt;BR /&gt;      echo $line&lt;BR /&gt;  fi&lt;BR /&gt;done &amp;lt; data.txt&lt;BR /&gt;&lt;BR /&gt;regards. &lt;BR /&gt;Steven</description>
      <pubDate>Sun, 21 Jul 2002 21:30:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768604#M74122</guid>
      <dc:creator>Steven Mertens</dc:creator>
      <dc:date>2002-07-21T21:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768605#M74123</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Here's another way:&lt;BR /&gt;&lt;BR /&gt;# cat datafile | tr ["\n"] [+] | perl -e 'while (&lt;STDIN&gt;) { $_ =~ s/\+START.+?END//g ; print $_; }' | tr [+] ["\n"]&lt;BR /&gt;&lt;BR /&gt;This is assuming that you don't have a plus (+) sign in any of your text. + can be replaced by any other separator character not found in your needed text.&lt;BR /&gt;&lt;BR /&gt;# cat datafile&lt;BR /&gt;this is line 1&lt;BR /&gt;this is line 2&lt;BR /&gt;START&lt;BR /&gt;this is line 3&lt;BR /&gt;this is line 4&lt;BR /&gt;this is line 5&lt;BR /&gt;this is line 6&lt;BR /&gt;END&lt;BR /&gt;this is line 8&lt;BR /&gt;START&lt;BR /&gt;this is line 10&lt;BR /&gt;END&lt;BR /&gt;&lt;BR /&gt;# cat datafile | tr ["\n"] [+] | perl -e 'while (&lt;STDIN&gt;) { $_ =~ s/\+START.+?END//g; print $_; }' | tr [+] ["\n"]&lt;BR /&gt;this is line 1&lt;BR /&gt;this is line 2&lt;BR /&gt;this is line 8&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;/STDIN&gt;&lt;/STDIN&gt;</description>
      <pubDate>Mon, 22 Jul 2002 01:03:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768605#M74123</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-07-22T01:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768606#M74124</link>
      <description>l1:/tmp 118 &amp;gt; cat xx&lt;BR /&gt;line1&lt;BR /&gt;line2&lt;BR /&gt;START&lt;BR /&gt;line3&lt;BR /&gt;-&lt;BR /&gt;-&lt;BR /&gt;Line7&lt;BR /&gt;END&lt;BR /&gt;some lines 1&lt;BR /&gt;START&lt;BR /&gt;some lines 2&lt;BR /&gt;END&lt;BR /&gt;l1:/tmp 119 &amp;gt; perl -ne '/^START/../^END/ or print' xx&lt;BR /&gt;line1&lt;BR /&gt;line2&lt;BR /&gt;some lines 1&lt;BR /&gt;l1:/tmp 120 &amp;gt;</description>
      <pubDate>Mon, 22 Jul 2002 04:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768606#M74124</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-07-22T04:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768607#M74125</link>
      <description>Thank you all.&lt;BR /&gt;It is working fine.</description>
      <pubDate>Mon, 22 Jul 2002 05:04:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768607#M74125</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2002-07-22T05:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768608#M74126</link>
      <description>I know that you already have several solutions, include procura's simple perl one, but I just would like you to know that even 'simple' sed(1) can do this in a simple way, i.e. as simple as perl:&lt;BR /&gt;&lt;BR /&gt;sed '/START/,/END/d' &lt;INPUT /&gt;output&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jul 2002 10:12:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/formatting/m-p/2768608#M74126</guid>
      <dc:creator>Frank Slootweg</dc:creator>
      <dc:date>2002-07-22T10:12:09Z</dc:date>
    </item>
  </channel>
</rss>

