<?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: Replace a Blank Char to ~ (tilde) Using 'sed' Command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499347#M680729</link>
    <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;Got it. Resolved the issue using perl command as advised above. Thanks alot to you all for the great help. &lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;</description>
    <pubDate>Thu, 17 Sep 2009 12:46:21 GMT</pubDate>
    <dc:creator>Dewa Negara_4</dc:creator>
    <dc:date>2009-09-17T12:46:21Z</dc:date>
    <item>
      <title>Replace a Blank Char to ~ (tilde) Using 'sed' Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499342#M680724</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;I have an output below:&lt;BR /&gt;bdhp4126.na.pg.com       ~17 Sep 2009~06:45:01~W~FILE&lt;BR /&gt;&lt;BR /&gt;I want to add tilde (~) between date and month (char 29), and between month and year (char 33). So the output will be like below:&lt;BR /&gt;bdhp4126.na.pg.com     ~17~Sep~2009~06:45:01~W~FILE&lt;BR /&gt;&lt;BR /&gt;How can we do that using sed command? Please help. Thanks in advance. &lt;BR /&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Thu, 17 Sep 2009 10:09:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499342#M680724</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2009-09-17T10:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a Blank Char to ~ (tilde) Using 'sed' Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499343#M680725</link>
      <description>Just a regular expression...&lt;BR /&gt;&lt;BR /&gt;Using perl:&lt;BR /&gt;&lt;BR /&gt;$ cat x&lt;BR /&gt;bdhp4126.na.pg.com ~17 Sep 2009~06:45:01~W~FILE&lt;BR /&gt;$&lt;BR /&gt;$ perl -pe "s/(\d+) (\w+) (\d+)/\1~\2~\3/" x&lt;BR /&gt;bdhp4126.na.pg.com ~17~Sep~2009~06:45:01~W~FILE&lt;BR /&gt;&lt;BR /&gt;So that looks for some numbers followed by a space stored in $1 (day)&lt;BR /&gt;followed by a word stored in $2 (month)&lt;BR /&gt;followed by a space and more numbers in $3 for the year.&lt;BR /&gt;Re-assemble with the tildes.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Sep 2009 10:19:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499343#M680725</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-09-17T10:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a Blank Char to ~ (tilde) Using 'sed' Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499344#M680726</link>
      <description>Hi,&lt;BR /&gt;awk '{ print $1" "$2"~"$3"~"$4 } &lt;INPUTFILE&gt;outputfile&lt;BR /&gt;&lt;BR /&gt;OR&lt;BR /&gt;&lt;BR /&gt;awk '{&lt;BR /&gt;       a=substr($0,1,22)&lt;BR /&gt;       b=substr($0,24,3)&lt;BR /&gt;       c=substr($0,28,20)&lt;BR /&gt;       print a~b~c&lt;BR /&gt;      }'&lt;INPUTFILE&gt;outputfile&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;awk '{&lt;BR /&gt;       print substr($0,1,22)"~"substr($0,24,3)"~"substr($0,28,20)&lt;BR /&gt;     }'&lt;INPUTFILE&gt;outputfile&lt;BR /&gt;&lt;BR /&gt;Suraj&lt;/INPUTFILE&gt;&lt;/INPUTFILE&gt;&lt;/INPUTFILE&gt;</description>
      <pubDate>Thu, 17 Sep 2009 10:37:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499344#M680726</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-09-17T10:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a Blank Char to ~ (tilde) Using 'sed' Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499345#M680727</link>
      <description>Hi,&lt;BR /&gt;awk '{ print $1" "$2"~"$3"~"$4 }' &lt;INPUTFILE&gt;outputfile&lt;BR /&gt;&lt;BR /&gt;Suraj&lt;/INPUTFILE&gt;</description>
      <pubDate>Thu, 17 Sep 2009 10:44:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499345#M680727</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-09-17T10:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a Blank Char to ~ (tilde) Using 'sed' Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499346#M680728</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Your requirement, based on the data presented, seems as simple as replacing blank characters with tildes.  If that's truly the case, using 'sed' (as requested) this becomes:&lt;BR /&gt;&lt;BR /&gt;# X="bdhp4126.na.pg.com ~17 Sep 2009~06:45:01~W~FILE"&lt;BR /&gt;&lt;BR /&gt;# echo ${X}|sed -e 's/[ ]/~/g' &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Sep 2009 11:19:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499346#M680728</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-09-17T11:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Replace a Blank Char to ~ (tilde) Using 'sed' Command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499347#M680729</link>
      <description>Hi All, &lt;BR /&gt;&lt;BR /&gt;Got it. Resolved the issue using perl command as advised above. Thanks alot to you all for the great help. &lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Sep 2009 12:46:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/replace-a-blank-char-to-tilde-using-sed-command/m-p/4499347#M680729</guid>
      <dc:creator>Dewa Negara_4</dc:creator>
      <dc:date>2009-09-17T12:46:21Z</dc:date>
    </item>
  </channel>
</rss>

