<?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: Editing a file using 'sed' in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913977#M933784</link>
    <description>Thanks to both of you!&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 26 Feb 2003 18:02:15 GMT</pubDate>
    <dc:creator>Paul Booth (IAD)</dc:creator>
    <dc:date>2003-02-26T18:02:15Z</dc:date>
    <item>
      <title>Editing a file using 'sed'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913973#M933780</link>
      <description>I've got a text file which I need to make numerous changes to.  The changes need to be made in the following sequence.&lt;BR /&gt;&lt;BR /&gt;1. Remove all / from file&lt;BR /&gt;2. Remove all spaces that follow   =&lt;BR /&gt;3. Remove all spaces that follow   +&lt;BR /&gt;4. Remove all spaces that follow   :&lt;BR /&gt;5. Reduce remaining multiple spaces on lines to 1 space&lt;BR /&gt;6. Remove blank lines from file &lt;BR /&gt;7. Change all occurances of \ to spaces&lt;BR /&gt;&lt;BR /&gt;Hope you can help!</description>
      <pubDate>Wed, 26 Feb 2003 16:52:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913973#M933780</guid>
      <dc:creator>Paul Booth (IAD)</dc:creator>
      <dc:date>2003-02-26T16:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a file using 'sed'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913974#M933781</link>
      <description>sed "s$/$$g" file &amp;gt; file.tmp;mv file.tmp file&lt;BR /&gt;sed "s/= /=/g" file &amp;gt; file.tmp;mv file.tmp file&lt;BR /&gt;sed "s/+ /+/g" file &amp;gt; file.tmp;mv file.tmp file&lt;BR /&gt;sed "s/: /:/g" file &amp;gt; file.tmp;mv file.tmp file&lt;BR /&gt;sed "s/\w+/\w/g" file &amp;gt; file.tmp;mv file.tmp file&lt;BR /&gt;sed "s/\\/ /g" file &amp;gt; file.tmp;mv file.tmp file&lt;BR /&gt;&lt;BR /&gt;Good Luck.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 26 Feb 2003 17:42:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913974#M933781</guid>
      <dc:creator>Steve Labar</dc:creator>
      <dc:date>2003-02-26T17:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a file using 'sed'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913975#M933782</link>
      <description>Hi Paul:&lt;BR /&gt;&lt;BR /&gt;1. # sed -e 's%/%%'g  &lt;BR /&gt;2. # sed -e 's%= %=%'g&lt;BR /&gt;3. # sed -e 's%= %+%'g&lt;BR /&gt;4. # sed -e 's%= %:%'g&lt;BR /&gt;5. # sed 's/  */ /g'  #...that 2-spaces before the asterisk character.&lt;BR /&gt;6. # sed '/^$/d&lt;BR /&gt;7. # sed -e 's%\\% %'g&lt;BR /&gt;&lt;BR /&gt;Note that doing step-5 first simplifies the remaining edits.  In fact, depending on your objective, the point at which you do step-7 might differ too.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 26 Feb 2003 17:43:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913975#M933782</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-02-26T17:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a file using 'sed'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913976#M933783</link>
      <description>Hi (again) Paul:&lt;BR /&gt;&lt;BR /&gt;Oops, I fat-fingered my own cut-and-paste for #3 and #4 (which is obvious if you look at my original post!):&lt;BR /&gt;&lt;BR /&gt;3. # sed -e 's%+ %+%'g &lt;BR /&gt;4. # sed -e 's%: %:%'g &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Feb 2003 17:51:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913976#M933783</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-02-26T17:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a file using 'sed'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913977#M933784</link>
      <description>Thanks to both of you!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Feb 2003 18:02:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913977#M933784</guid>
      <dc:creator>Paul Booth (IAD)</dc:creator>
      <dc:date>2003-02-26T18:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a file using 'sed'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913978#M933785</link>
      <description>Hi Paul,&lt;BR /&gt;&lt;BR /&gt;This will delete all spaces and tabs followed by =,+ and : along with the others you mentioned. 'data' is your input file.&lt;BR /&gt;&lt;BR /&gt;sed -e 's/\///g' \                              &lt;BR /&gt;-e 's/=[        ]*/=/g' \    #[&lt;SPACE&gt;&lt;TAB&gt;]    &lt;BR /&gt;-e 's/+[        ]*/+/g' \    #[&lt;SPACE&gt;&lt;TAB&gt;]    &lt;BR /&gt;-e 's/:[        ]*/:/g' \    #[&lt;SPACE&gt;&lt;TAB&gt;]    &lt;BR /&gt;-e 's/  */ /g' \             #/&lt;SPACE&gt;&lt;SPACE&gt;*/ &lt;BR /&gt;-e '/^ *$/d' \               #/^&lt;SPACE&gt;*$/      &lt;BR /&gt;-e 's/\\//g' data                               &lt;BR /&gt;&lt;BR /&gt;-Sri&lt;/SPACE&gt;&lt;/SPACE&gt;&lt;/SPACE&gt;&lt;/TAB&gt;&lt;/SPACE&gt;&lt;/TAB&gt;&lt;/SPACE&gt;&lt;/TAB&gt;&lt;/SPACE&gt;</description>
      <pubDate>Wed, 26 Feb 2003 21:12:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913978#M933785</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-02-26T21:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Editing a file using 'sed'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913979#M933786</link>
      <description>sed -e 's/[=+:][ \t]*//g'&lt;BR /&gt;    -e 's/\///g'&lt;BR /&gt;    -e '/./!d'&lt;BR /&gt;    -e 's/  */ /g'&lt;BR /&gt;     -e 's/\\/ /g' test.txt &amp;gt; new.txt&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Feb 2003 17:19:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/editing-a-file-using-sed/m-p/2913979#M933786</guid>
      <dc:creator>Rory R Hammond</dc:creator>
      <dc:date>2003-02-27T17:19:10Z</dc:date>
    </item>
  </channel>
</rss>

