<?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: script substitute with regular expression in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134343#M799804</link>
    <description>Thanks Mark !&lt;BR /&gt;That's what I needed.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Franky</description>
    <pubDate>Wed, 03 Dec 2003 04:23:38 GMT</pubDate>
    <dc:creator>Franky Leeuwerck_1</dc:creator>
    <dc:date>2003-12-03T04:23:38Z</dc:date>
    <item>
      <title>script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134336#M799797</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;I need some help on the following script problem.&lt;BR /&gt;&lt;BR /&gt;How can I change a fraction at the beginning of a line in this way :&lt;BR /&gt;&lt;BR /&gt;'Dec 3 09' should be changed into 'Dec  3 09' .&lt;BR /&gt;'Dec 12 09' should stay that way.&lt;BR /&gt;&lt;BR /&gt;The first 3 characters ( month) can be different, also the last two digits (day of the month).&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Franky</description>
      <pubDate>Wed, 03 Dec 2003 03:54:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134336#M799797</guid>
      <dc:creator>Franky Leeuwerck_1</dc:creator>
      <dc:date>2003-12-03T03:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134337#M799798</link>
      <description>It is not clearly visible in the web page, but the string to be replaced contains two spaces between the month and the day of the of the month number.&lt;BR /&gt;&lt;BR /&gt;Franky</description>
      <pubDate>Wed, 03 Dec 2003 03:57:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134337#M799798</guid>
      <dc:creator>Franky Leeuwerck_1</dc:creator>
      <dc:date>2003-12-03T03:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134338#M799799</link>
      <description>if I understand you correctly, you want to remove an extra space which is between one of those three "words"&lt;BR /&gt; &lt;BR /&gt;If so, then this will return the fields without the extra space&lt;BR /&gt; &lt;BR /&gt;echo "Dec  02 09"| awk '{printf "%s %s %s", $1,$2,$3}'&lt;BR /&gt; &lt;BR /&gt;Please clarify if you need something else.</description>
      <pubDate>Wed, 03 Dec 2003 04:07:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134338#M799799</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-03T04:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134339#M799800</link>
      <description>In that case I think you need the following:&lt;BR /&gt;sed 's|  *| |g'&lt;BR /&gt;&lt;BR /&gt;This will replace all multiple spaces to a single space.&lt;BR /&gt;&lt;BR /&gt;Or, if the month is at the start of the line, it can be done in a better way:&lt;BR /&gt;sed 's|^\([A-Za-z]*\)  |\1 |g'&lt;BR /&gt;(Mind the double space after the closing bracket!)</description>
      <pubDate>Wed, 03 Dec 2003 04:10:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134339#M799800</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-03T04:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134340#M799801</link>
      <description>Hello Mark,&lt;BR /&gt;&lt;BR /&gt;Thanks for your quick reply.&lt;BR /&gt;&lt;BR /&gt;No, that's not want I need. Sorry, for the unclear explanation.&lt;BR /&gt;&lt;BR /&gt;This is what I need. I will mark the space with 'SPACE' to make the example clear.&lt;BR /&gt;&lt;BR /&gt;'DecSPACE3SPACE9' should be replaced with&lt;BR /&gt;'DecSPACESPACE3SPACE9'&lt;BR /&gt;&lt;BR /&gt;'DecSPACE10SPACE9' should stay that way.&lt;BR /&gt;&lt;BR /&gt;Franky&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Dec 2003 04:13:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134340#M799801</guid>
      <dc:creator>Franky Leeuwerck_1</dc:creator>
      <dc:date>2003-12-03T04:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134341#M799802</link>
      <description>Hi Elmar,&lt;BR /&gt;&lt;BR /&gt;See my reply to Mark.</description>
      <pubDate>Wed, 03 Dec 2003 04:15:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134341#M799802</guid>
      <dc:creator>Franky Leeuwerck_1</dc:creator>
      <dc:date>2003-12-03T04:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134342#M799803</link>
      <description>Ahh, got you :)&lt;BR /&gt; &lt;BR /&gt;In that case&lt;BR /&gt;&lt;BR /&gt;echo "Dec 2 09" | awk '{printf "%s %2s %s", $1,$2,$3}'&lt;BR /&gt; &lt;BR /&gt;Regards</description>
      <pubDate>Wed, 03 Dec 2003 04:16:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134342#M799803</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-03T04:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134343#M799804</link>
      <description>Thanks Mark !&lt;BR /&gt;That's what I needed.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Franky</description>
      <pubDate>Wed, 03 Dec 2003 04:23:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134343#M799804</guid>
      <dc:creator>Franky Leeuwerck_1</dc:creator>
      <dc:date>2003-12-03T04:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: script substitute with regular expression</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134344#M799805</link>
      <description>Hi,&lt;BR /&gt;try this, using your infile as $1:&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset -R2 day&lt;BR /&gt;while read month day number&lt;BR /&gt;do&lt;BR /&gt;echo "$month" "$day" "$number"&lt;BR /&gt;done &amp;lt;$1&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Dec 2003 04:24:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-substitute-with-regular-expression/m-p/3134344#M799805</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-12-03T04:24:02Z</dc:date>
    </item>
  </channel>
</rss>

