<?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: Replacing text with multiple lines in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505304#M887229</link>
    <description>You can use sed as follows-&lt;BR /&gt;sed -e 's/SET/SET\^MTROUBLETICKET/'&lt;BR /&gt;&lt;BR /&gt;Following the \, press ctl-v followed by the return-key.</description>
    <pubDate>Wed, 14 Mar 2001 22:25:08 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2001-03-14T22:25:08Z</dc:date>
    <item>
      <title>Replacing text with multiple lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505303#M887228</link>
      <description>Full 10 points for who ever solves this one for me.....&lt;BR /&gt;&lt;BR /&gt;I have a text config file.&lt;BR /&gt;I want to replace any instance of the word SET with &lt;BR /&gt;"SET&lt;BR /&gt;TROUBLETICKET".&lt;BR /&gt;&lt;BR /&gt;I tried sed and awk but they get confused with the carriage return between set and troubleticket which is required. Any ideas? I need to make this an automatic process because there is going to be around 800 hundred instances of SET in this file and we need to do this translation about once a month. Any help would be appreciated (along with ten points). Thank you.</description>
      <pubDate>Wed, 14 Mar 2001 21:46:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505303#M887228</guid>
      <dc:creator>Quin Hammes</dc:creator>
      <dc:date>2001-03-14T21:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing text with multiple lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505304#M887229</link>
      <description>You can use sed as follows-&lt;BR /&gt;sed -e 's/SET/SET\^MTROUBLETICKET/'&lt;BR /&gt;&lt;BR /&gt;Following the \, press ctl-v followed by the return-key.</description>
      <pubDate>Wed, 14 Mar 2001 22:25:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505304#M887229</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2001-03-14T22:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing text with multiple lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505305#M887230</link>
      <description>I think I did it exaclt the way you said but it only spitted back TROUBLETICKET not&lt;BR /&gt;SET&lt;BR /&gt;TROUBLETICKET&lt;BR /&gt;&lt;BR /&gt;any ideas?</description>
      <pubDate>Wed, 14 Mar 2001 22:31:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505305#M887230</guid>
      <dc:creator>Quin Hammes</dc:creator>
      <dc:date>2001-03-14T22:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing text with multiple lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505306#M887231</link>
      <description>I figured it out, I did a "\" then a control M right away and it seemed to work. Thanks for the help.</description>
      <pubDate>Wed, 14 Mar 2001 22:34:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505306#M887231</guid>
      <dc:creator>Quin Hammes</dc:creator>
      <dc:date>2001-03-14T22:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing text with multiple lines</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505307#M887232</link>
      <description>Here is a little script that should do what you need to do.  It is probably not the most efficient, but it works.  &lt;BR /&gt;*******************************start script&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;inputfile="/tmp/pww/file"&lt;BR /&gt;outputfile="/tmp/pww/file1"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;outputfile1="/tmp/pww/file2"&lt;BR /&gt;&lt;BR /&gt;cat $inputfile | awk '{ gsub(/SET/,"SET TROUBLE TICKET" ); print }' &amp;gt; $outputfile&lt;BR /&gt;cat $outputfile | awk '&lt;BR /&gt;          {&lt;BR /&gt;                 if ( $1 != "SET" )&lt;BR /&gt;                    { print $0 }&lt;BR /&gt;                 else&lt;BR /&gt;                    { split($0,word," "); print word[1];print word[2],word[3] } &lt;BR /&gt;           }' &amp;gt; $outputfile1&lt;BR /&gt;&lt;BR /&gt;******************************end script&lt;BR /&gt;&lt;BR /&gt;you could even do something at the end of the script to move the the output file to the inputfile name.&lt;BR /&gt;&lt;BR /&gt;I hope the script makes sense.  It is also attached to this reply.</description>
      <pubDate>Wed, 14 Mar 2001 22:39:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replacing-text-with-multiple-lines/m-p/2505307#M887232</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2001-03-14T22:39:12Z</dc:date>
    </item>
  </channel>
</rss>

