<?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: Help to split a file into multiple files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147672#M717902</link>
    <description>Try:&lt;BR /&gt;&lt;BR /&gt;csplit -k myfile '/#! rnews 0/' '{*}'&lt;BR /&gt;rm xx00&lt;BR /&gt;&lt;BR /&gt;for file in $(ls xx??);do&lt;BR /&gt;newname=$(grep ^Xref ${file}|awk -F":" '{print $3}')&lt;BR /&gt;mv ${file} ${newname}&lt;BR /&gt;done&lt;BR /&gt;</description>
    <pubDate>Wed, 17 Dec 2003 19:36:18 GMT</pubDate>
    <dc:creator>James A. Donovan</dc:creator>
    <dc:date>2003-12-17T19:36:18Z</dc:date>
    <item>
      <title>Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147668#M717898</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a Large Newsgroup file in rnews format.&lt;BR /&gt;I need to split messages in this file into sub files so that each message in a seperate file.&lt;BR /&gt;Please see below for file format. Each message starts with  a line "#! rnews 0". I want to read from that line to next "#! rnews 0" not including the "#! rnews 0".  The message number is displayed at the end of line starting "xref". I want to name the file as this number. Any help from AWK/SED Guru's are appreciated.&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;Xref: linux-nntp sybase.test:6&lt;BR /&gt;&lt;BR /&gt;zzzzzzzzzzzzzzzzzzzzz&lt;BR /&gt;&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;Xref: linux-nntp sybase.test:7&lt;BR /&gt;zzzzzzzzzzzzzzzzzzzzz&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Dec 2003 18:31:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147668#M717898</guid>
      <dc:creator>Praveen Hari</dc:creator>
      <dc:date>2003-12-17T18:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147669#M717899</link>
      <description>Have you looked at the split/csplit commands ?</description>
      <pubDate>Wed, 17 Dec 2003 18:44:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147669#M717899</guid>
      <dc:creator>Michael Tully</dc:creator>
      <dc:date>2003-12-17T18:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147670#M717900</link>
      <description>I have never used csplit. Cany you help me with some code snippets.&lt;BR /&gt;I am not expert in Shell scripts&lt;BR /&gt;Thanks</description>
      <pubDate>Wed, 17 Dec 2003 18:54:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147670#M717900</guid>
      <dc:creator>Praveen Hari</dc:creator>
      <dc:date>2003-12-17T18:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147671#M717901</link>
      <description># perl -ne'BEGIN{$/="#! rnews 0\n"}chomp;$_||next;open STDOUT,"&amp;gt;news.".++$i' file&lt;BR /&gt;&lt;BR /&gt;untested&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 17 Dec 2003 19:29:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147671#M717901</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-12-17T19:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147672#M717902</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt;csplit -k myfile '/#! rnews 0/' '{*}'&lt;BR /&gt;rm xx00&lt;BR /&gt;&lt;BR /&gt;for file in $(ls xx??);do&lt;BR /&gt;newname=$(grep ^Xref ${file}|awk -F":" '{print $3}')&lt;BR /&gt;mv ${file} ${newname}&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Dec 2003 19:36:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147672#M717902</guid>
      <dc:creator>James A. Donovan</dc:creator>
      <dc:date>2003-12-17T19:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147673#M717903</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this also.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Dec 2003 20:10:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147673#M717903</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-17T20:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147674#M717904</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;my last solution had a little flaw.&lt;BR /&gt;It forgot the text of the news. :-(&lt;BR /&gt;try this one.&lt;BR /&gt;&lt;BR /&gt;have fun,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Dec 2003 20:36:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147674#M717904</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-17T20:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help to split a file into multiple files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147675#M717905</link>
      <description>csPlit works fine.&lt;BR /&gt;I need help to do following in each file:&lt;BR /&gt;Each file has format:&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;&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>Wed, 17 Dec 2003 20:37:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/help-to-split-a-file-into-multiple-files/m-p/3147675#M717905</guid>
      <dc:creator>Praveen Hari</dc:creator>
      <dc:date>2003-12-17T20:37:15Z</dc:date>
    </item>
  </channel>
</rss>

