<?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: Awk Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891171#M102883</link>
    <description>Hi,&lt;BR /&gt;Or with shell script:&lt;BR /&gt;&lt;BR /&gt;while read a&lt;BR /&gt;do&lt;BR /&gt;echo "insert '"$a"'"&lt;BR /&gt;done</description>
    <pubDate>Tue, 28 Jan 2003 19:20:16 GMT</pubDate>
    <dc:creator>Leif Halvarsson_2</dc:creator>
    <dc:date>2003-01-28T19:20:16Z</dc:date>
    <item>
      <title>Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891168#M102880</link>
      <description>Hi Masters,&lt;BR /&gt;     I am having file containing numbers&lt;BR /&gt;23654&lt;BR /&gt;234444&lt;BR /&gt;23444&lt;BR /&gt;  &lt;BR /&gt;I want the output like below,&lt;BR /&gt;insert '23654'&lt;BR /&gt;insert '234444'&lt;BR /&gt;insert '23444'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In short, how can i print ' in awk.&lt;BR /&gt;Thanks in adv&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Jan 2003 19:02:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891168#M102880</guid>
      <dc:creator>Ash_4</dc:creator>
      <dc:date>2003-01-28T19:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891169#M102881</link>
      <description>cat file | awk '{print "'"$1"'"}'</description>
      <pubDate>Tue, 28 Jan 2003 19:03:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891169#M102881</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-01-28T19:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891170#M102882</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;you mean:&lt;BR /&gt;&lt;BR /&gt;cat file | awk '{print "insert '"$1"'"}'&lt;BR /&gt;&lt;BR /&gt;or faster:&lt;BR /&gt;&lt;BR /&gt;sed "s/.*/insert \'&amp;amp;1\'/" &amp;lt; filename&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 28 Jan 2003 19:12:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891170#M102882</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-28T19:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891171#M102883</link>
      <description>Hi,&lt;BR /&gt;Or with shell script:&lt;BR /&gt;&lt;BR /&gt;while read a&lt;BR /&gt;do&lt;BR /&gt;echo "insert '"$a"'"&lt;BR /&gt;done</description>
      <pubDate>Tue, 28 Jan 2003 19:20:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891171#M102883</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2003-01-28T19:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891172#M102884</link>
      <description>Harry - yeah... i guess... i didn't realize that they wanted the "insert" in the statement as  well.</description>
      <pubDate>Tue, 28 Jan 2003 19:23:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891172#M102884</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-01-28T19:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891173#M102885</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;This works:&lt;BR /&gt;&lt;BR /&gt;awk ' { printf "\x027insert\x027%s\n",$0 } ' inputfilename&lt;BR /&gt;&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Tue, 28 Jan 2003 19:24:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891173#M102885</guid>
      <dc:creator>Tom Jackson</dc:creator>
      <dc:date>2003-01-28T19:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891174#M102886</link>
      <description>Harry's sed problem is best, though it does not need the escapes for the quotes, nor does it need the redirection:&lt;BR /&gt;&lt;BR /&gt;l1:/tmp 102 &amp;gt; cat &amp;gt; xx&lt;BR /&gt;23654&lt;BR /&gt;234444&lt;BR /&gt;23444&lt;BR /&gt;l1:/tmp 103 &amp;gt; sed "s/.*/insert '&amp;amp;1'/" xx&lt;BR /&gt;insert '236541'&lt;BR /&gt;insert '2344441'&lt;BR /&gt;insert '234441'&lt;BR /&gt;l1:/tmp 104 &amp;gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 29 Jan 2003 09:26:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891174#M102886</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-01-29T09:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891175#M102887</link>
      <description>Oh Oh!&lt;BR /&gt;it should be :&lt;BR /&gt;sed "s/.*/insert \'&amp;amp;\'/" &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;because &amp;amp;1 append a '1' on each line.</description>
      <pubDate>Wed, 29 Jan 2003 11:10:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891175#M102887</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2003-01-29T11:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891176#M102888</link>
      <description>&lt;BR /&gt;John,&lt;BR /&gt;&lt;BR /&gt;I'm not sure the author will reply back.&lt;BR /&gt;&lt;BR /&gt;Carlos,&lt;BR /&gt;You're right, I mangled the sed, here's one that works (and I took Procura's advice and removed the escaping of the apost's):&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sed "s/\(.*\)/insert '\1'/" filename&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 29 Jan 2003 12:14:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891176#M102888</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-29T12:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891177#M102889</link>
      <description>Hi, &lt;BR /&gt;    Extremly sorry for delay.&lt;BR /&gt;If have two field like below&lt;BR /&gt;293874 239487&lt;BR /&gt;239478 239487&lt;BR /&gt;----------&lt;BR /&gt;i want output as using "SED" or AWK&lt;BR /&gt;'293874' , '239487'&lt;BR /&gt;'239478' , '239487'&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Jan 2003 03:37:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891177#M102889</guid>
      <dc:creator>Ash_4</dc:creator>
      <dc:date>2003-01-30T03:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891178#M102890</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;echo "this is the trick" | awk '{printf("'\''%s'\''\n",$0)}'&lt;BR /&gt;&lt;BR /&gt;in your case:&lt;BR /&gt;# cat inputfile&lt;BR /&gt;293874 239487&lt;BR /&gt;239478 239487&lt;BR /&gt;#  awk '{printf("'\''%s'\'','\''%s'\''\n",$1,$2)}' inputfile&lt;BR /&gt;'293874','239487'&lt;BR /&gt;'239478','239487'&lt;BR /&gt;&lt;BR /&gt;very clear, isn't it? ;-)&lt;BR /&gt;&lt;BR /&gt;Chris&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Jan 2003 06:24:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891178#M102890</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2003-01-30T06:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891179#M102891</link>
      <description>uuups, with my browser i cannot read the quotes exactly, please try copy and paste and you will see:&lt;BR /&gt;quote-backslash-quote-quote to print  '  in awk&lt;BR /&gt;&lt;BR /&gt;Chris</description>
      <pubDate>Thu, 30 Jan 2003 06:28:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891179#M102891</guid>
      <dc:creator>Christian Gebhardt</dc:creator>
      <dc:date>2003-01-30T06:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891180#M102892</link>
      <description>Why not perl? Does it have to be sed or awk? Perl is so much fun!&lt;BR /&gt;&lt;BR /&gt;Here's some obfuscated examples:&lt;BR /&gt;&lt;BR /&gt;l1:/tmp 121 &amp;gt; cat file&lt;BR /&gt;12345&lt;BR /&gt;23456 78901&lt;BR /&gt;34567 89012 62534&lt;BR /&gt;45678 90123 72635 91827&lt;BR /&gt;l1:/tmp 122 &amp;gt; perl -ple '$"=",";$_=qq{@{[map{qq{\x27$_\x27}}split/\D+/]}}' file&lt;BR /&gt;'12345'&lt;BR /&gt;'23456','78901'&lt;BR /&gt;'34567','89012','62534'&lt;BR /&gt;'45678','90123','72635','91827'&lt;BR /&gt;l1:/tmp 123 &amp;gt; perl -nle 'print+v39,join(v39.44.39,split/\D+/),v39' file&lt;BR /&gt;'12345'&lt;BR /&gt;'23456','78901'&lt;BR /&gt;'34567','89012','62534'&lt;BR /&gt;'45678','90123','72635','91827'&lt;BR /&gt;l1:/tmp 124 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Thu, 30 Jan 2003 08:31:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891180#M102892</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-01-30T08:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Awk Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891181#M102893</link>
      <description>sed -e "s/$/ /" -e "s/\([0-9]*\)[[:space:]]/'\1',/g" -e "s/'',//g" -e "s/',$/'/" filename&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Works like this:&lt;BR /&gt;&lt;BR /&gt;(1) The first "-e"&lt;BR /&gt;&lt;BR /&gt;-e "s/$/ /"&lt;BR /&gt;&lt;BR /&gt;Appends a space to the end of the line (so the next test will always work - hacking)&lt;BR /&gt;&lt;BR /&gt;(2) the second "-e"&lt;BR /&gt; -e "s/\([0-9]*\)[[:space:]]/'\1',/g" &lt;BR /&gt;&lt;BR /&gt;Says match all number groups (numbers seperated by spaces, then wrap them with apost's and a comma)&lt;BR /&gt;&lt;BR /&gt;(3) the third "-e"&lt;BR /&gt;&lt;BR /&gt;-e "s/'',//g"&lt;BR /&gt;&lt;BR /&gt;removes any BOGUS '', stuff&lt;BR /&gt;&lt;BR /&gt;(4) the forth "-e"&lt;BR /&gt;&lt;BR /&gt;-e "s/',$/'/"&lt;BR /&gt;&lt;BR /&gt;Removes other BOGUS ', at the end of the line&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Thu, 30 Jan 2003 14:54:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/awk-help/m-p/2891181#M102893</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-30T14:54:06Z</dc:date>
    </item>
  </channel>
</rss>

