<?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: sed command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023397#M762718</link>
    <description>Here is your command, tested ;-p&lt;BR /&gt;&lt;BR /&gt;cat test | sed 's/value/!value/g' | awk 'BEGIN { RS  = "!" ; FS = "\n" } {print $1 " " $2 " " $3 " " $4}'&lt;BR /&gt;&lt;BR /&gt;Cedric.</description>
    <pubDate>Thu, 18 Jan 2007 06:36:48 GMT</pubDate>
    <dc:creator>Cédric MELLON</dc:creator>
    <dc:date>2007-01-18T06:36:48Z</dc:date>
    <item>
      <title>sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023394#M762715</link>
      <description>I Have attached the file. I need the file in the format&lt;BR /&gt;value &lt;ROWS updated=""&gt;  &lt;ROWS modified=""&gt;  &lt;ROWS deleted=""&gt;&lt;BR /&gt;&lt;/ROWS&gt;&lt;/ROWS&gt;&lt;/ROWS&gt;</description>
      <pubDate>Thu, 18 Jan 2007 05:54:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023394#M762715</guid>
      <dc:creator>Pavitra</dc:creator>
      <dc:date>2007-01-18T05:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023395#M762716</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you can do that with sed and awk&lt;BR /&gt;sed : add a separator character before the string "value" =&amp;gt; "!value" for exemple&lt;BR /&gt;awk : use this character as begin of line and the carriage return as separator of fields&lt;BR /&gt;&lt;BR /&gt;Hope that will helps,&lt;BR /&gt;Cedric.</description>
      <pubDate>Thu, 18 Jan 2007 06:13:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023395#M762716</guid>
      <dc:creator>Cédric MELLON</dc:creator>
      <dc:date>2007-01-18T06:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023396#M762717</link>
      <description>Hi,&lt;BR /&gt;not in sed/awk, but old-fashioned shell ;-)&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;a=1&lt;BR /&gt;while read record&lt;BR /&gt;do&lt;BR /&gt;if [ $a -eq 1 ]&lt;BR /&gt;then&lt;BR /&gt;value="$record"&lt;BR /&gt;a=`expr $a + 1`&lt;BR /&gt;else&lt;BR /&gt;count=`echo "$record" | awk '{print $3}'`&lt;BR /&gt;count2="`echo $count2` $count"&lt;BR /&gt;if [ $a -le 3 ]&lt;BR /&gt;then&lt;BR /&gt;a=`expr $a + 1`&lt;BR /&gt;else&lt;BR /&gt;echo $value $count2&lt;BR /&gt;a=1&lt;BR /&gt;count2=""&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;done &amp;lt; a.lis&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Please also read:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt; on how to reward any useful answers given to your questions.&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jan 2007 06:20:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023396#M762717</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-01-18T06:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023397#M762718</link>
      <description>Here is your command, tested ;-p&lt;BR /&gt;&lt;BR /&gt;cat test | sed 's/value/!value/g' | awk 'BEGIN { RS  = "!" ; FS = "\n" } {print $1 " " $2 " " $3 " " $4}'&lt;BR /&gt;&lt;BR /&gt;Cedric.</description>
      <pubDate>Thu, 18 Jan 2007 06:36:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023397#M762718</guid>
      <dc:creator>Cédric MELLON</dc:creator>
      <dc:date>2007-01-18T06:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023398#M762719</link>
      <description>You can use awk.  (Your example input contains an initial blank line that causes problems.  Did you really want it?  The scripts below assume it isn't there.)&lt;BR /&gt;&lt;BR /&gt;awk '&lt;BR /&gt;{&lt;BR /&gt;s1 = $0&lt;BR /&gt;getline&lt;BR /&gt;s2 = $0&lt;BR /&gt;getline&lt;BR /&gt;s3 = $0&lt;BR /&gt;getline&lt;BR /&gt;print s1, s2, s3, $0&lt;BR /&gt;}' 284910.txt&lt;BR /&gt;&lt;BR /&gt;The following sed command will also work:&lt;BR /&gt;sed -n 'N;N;N;s/\n/ /g;p;d' 284910.txt</description>
      <pubDate>Thu, 18 Jan 2007 07:21:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023398#M762719</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-01-18T07:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023399#M762720</link>
      <description>&lt;!--!*#--&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I assume you only want to print the real values, no the whole text.&lt;BR /&gt;I added a header - if you don't need it, drop the 'BEGIN' section.&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN {printf("%s\t%s\t%s\t%s\n","value","insert","update","delete")}&lt;BR /&gt;NF==1 {if(val) printf ("%s\t%d\t%d\t%d\n",val,ins,upd,del);val=$1} &lt;BR /&gt;/^Rows inserted/ {ins=$3}&lt;BR /&gt;/^Rows updated/ {upd=$3}&lt;BR /&gt;/^Rows deleted/ {del=$3}&lt;BR /&gt;END {if(val) printf ("%s\t%d\t%d\t%d\n",val,ins,upd,del)}' yourfile&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Thu, 18 Jan 2007 09:29:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023399#M762720</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-01-18T09:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023400#M762721</link>
      <description>Hey,&lt;BR /&gt;Thanz Peter, Cedric,Dennis and Peter..&lt;BR /&gt;I got the required output..:-)</description>
      <pubDate>Fri, 19 Jan 2007 02:14:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023400#M762721</guid>
      <dc:creator>Pavitra</dc:creator>
      <dc:date>2007-01-19T02:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023401#M762722</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;nice to hear, that our solutions were valuable! Because you are new to this forum - Welcome! - I want to put your attention to its points system:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 19 Jan 2007 02:20:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023401#M762722</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-01-19T02:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023402#M762723</link>
      <description>&lt;!--!*#--&gt;Yet another way to do the same thing using ex(1):&lt;BR /&gt;&lt;BR /&gt;ex -s file &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;  g/^value/ j 3 | p&lt;BR /&gt;EOF</description>
      <pubDate>Fri, 19 Jan 2007 03:54:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023402#M762723</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-01-19T03:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023403#M762724</link>
      <description>&amp;gt;Sandman!: g/^value/ j 3 | p&lt;BR /&gt;&lt;BR /&gt;Thanks, I was never able to figure out how to join multiple lines in vi until I saw this and reread the man page.&lt;BR /&gt;&lt;BR /&gt;Though in visual mode, having to type ":j3" is  not much easier than "JJJ"</description>
      <pubDate>Fri, 19 Jan 2007 16:34:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023403#M762724</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-01-19T16:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023404#M762725</link>
      <description>thanx</description>
      <pubDate>Thu, 01 Feb 2007 07:48:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023404#M762725</guid>
      <dc:creator>Pavitra</dc:creator>
      <dc:date>2007-02-01T07:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: sed command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023405#M762726</link>
      <description>Hi Pavitra,&lt;BR /&gt;&lt;BR /&gt;to make it easier for others to find valuable solutions for their problems, please rate the answers to your questions.&lt;BR /&gt;&lt;BR /&gt;Here you'll find a description about this:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Thu, 01 Feb 2007 12:11:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sed-command/m-p/5023405#M762726</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2007-02-01T12:11:46Z</dc:date>
    </item>
  </channel>
</rss>

