<?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: File manipulation help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148577#M717944</link>
    <description>I got it partially working. I still need help on following part:&lt;BR /&gt;I have following line in the file:&lt;BR /&gt;&lt;BR /&gt;Xref: linux-nntp sybase.test.xml:99&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I need to extract the number 99 into a variable. I will be using this number to create  a new file with that name. Please help....</description>
    <pubDate>Thu, 18 Dec 2003 19:50:30 GMT</pubDate>
    <dc:creator>Praveen Hari</dc:creator>
    <dc:date>2003-12-18T19:50:30Z</dc:date>
    <item>
      <title>File manipulation help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148575#M717942</link>
      <description>#! rnews 0&lt;BR /&gt;Newsgroups: xxx&lt;BR /&gt;From: xxx&lt;BR /&gt;Subject: xxx&lt;BR /&gt;Date: xxx&lt;BR /&gt;Path: linux-nntp!forums-master!forums-1-dub!forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com&lt;BR /&gt;Xref: linux-nntp sybase.test.xml:99&lt;BR /&gt;zzzzzzzzzzzzzzzzzzzzz &lt;BR /&gt;&lt;BR /&gt;1)I need to replace "linux-nntp" in the line starting XRef: to "test".&lt;BR /&gt;2)I need to extract the number after sybase.text.xml from the line starting XRef: to a variable&lt;BR /&gt;3)Also I need to delete the text "linux-nntp!forums-master!" from the line starting "Path:"&lt;BR /&gt;&lt;BR /&gt;Can soem one provide scripts for doing these operations.&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 18 Dec 2003 12:33:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148575#M717942</guid>
      <dc:creator>Praveen Hari</dc:creator>
      <dc:date>2003-12-18T12:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: File manipulation help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148576#M717943</link>
      <description>You could try the following using "sed"-&lt;BR /&gt; &lt;BR /&gt;nbr=`sed -n -e '/^XRef/s/linux-nttp/test/' -e '/^Path: linux/d' -e 'w yournewfile' -e '/^XRef/s/^.*://p'` &lt;YOURORIGFILE&gt;&lt;/YOURORIGFILE&gt; &lt;BR /&gt;By using "w" command under sed, you can copy the lines to "yournewfile" making the changes. The -n option tells sed not to automatically print each line. The only "p" command above is used to print the number you want off the "Xref" line.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Thu, 18 Dec 2003 13:29:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148576#M717943</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-12-18T13:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: File manipulation help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148577#M717944</link>
      <description>I got it partially working. I still need help on following part:&lt;BR /&gt;I have following line in the file:&lt;BR /&gt;&lt;BR /&gt;Xref: linux-nntp sybase.test.xml:99&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I need to extract the number 99 into a variable. I will be using this number to create  a new file with that name. Please help....</description>
      <pubDate>Thu, 18 Dec 2003 19:50:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148577#M717944</guid>
      <dc:creator>Praveen Hari</dc:creator>
      <dc:date>2003-12-18T19:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: File manipulation help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148578#M717945</link>
      <description>First I need to find the line contating XRef. Then Extract the number 99 from that line into a variable. I will use that variable to create a New file. Following lines are there in the original file.&lt;BR /&gt;&lt;BR /&gt;#! rnews 0&lt;BR /&gt;Newsgroups: xxx&lt;BR /&gt;From: xxx&lt;BR /&gt;Subject: xxx&lt;BR /&gt;Date: xxx&lt;BR /&gt;Path: linux-nntp!forums-master!forums-1-dub!forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com&lt;BR /&gt;Xref: linux-nntp sybase.test.xml:99&lt;BR /&gt;zzzzzzzzzzzzzzzzzzzzz &lt;BR /&gt;</description>
      <pubDate>Thu, 18 Dec 2003 19:54:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148578#M717945</guid>
      <dc:creator>Praveen Hari</dc:creator>
      <dc:date>2003-12-18T19:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: File manipulation help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148579#M717946</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you dont need the number. Just run the sed commands or whatever comes up here, which is fine for you and then run the script of Jim from the other thread, you posted, to split the file.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Dec 2003 03:32:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148579#M717946</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-19T03:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: File manipulation help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148580#M717947</link>
      <description>Seems like it is time to move to perl... Or run sed on the single lines in a shell script. In shell, it would become something like this:&lt;BR /&gt;&lt;BR /&gt;outfile='default.output'&lt;BR /&gt;rnews 0 | while read line&lt;BR /&gt;do&lt;BR /&gt;   part1=$(echo $line | cut -d: -f1)&lt;BR /&gt;   case $part1 in&lt;BR /&gt;   Xref)&lt;BR /&gt;      line=$(echo $line | sed 's|linux-nntp|test|')&lt;BR /&gt;      outfile=$(echo $line | awk FS=: '{print $NF}')&lt;BR /&gt;      ;;&lt;BR /&gt;   Path)&lt;BR /&gt;      line=$(echo $line | sed 's|linux-nntp!forums-master!||'&lt;BR /&gt;      ;;&lt;BR /&gt;   *)&lt;BR /&gt;      ;;&lt;BR /&gt;   esac&lt;BR /&gt;   echo $line &amp;gt;&amp;gt; $outfile&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Dec 2003 04:00:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148580#M717947</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2003-12-19T04:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: File manipulation help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148581#M717948</link>
      <description>Hi Elmar,&lt;BR /&gt;&lt;BR /&gt;no offense, but your approach is flawed. It writes all lines including rnews until the first xref into default.output. After that it divides the news at the wrong place into wrong files. You will have to make a major design change to get it work. I think, the csplit in his other thread is a great idea and combined with a few sed commands should work nicely.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Dec 2003 06:12:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-manipulation-help/m-p/3148581#M717948</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-19T06:12:59Z</dc:date>
    </item>
  </channel>
</rss>

