- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Help to split a file into multiple files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 10:31 AM
тАО12-17-2003 10:31 AM
I have a Large Newsgroup file in rnews format.
I need to split messages in this file into sub files so that each message in a seperate file.
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.
#! rnews 0
Newsgroups: xxx
From: xxx
Subject: xxx
Date: xxx
Xref: linux-nntp sybase.test:6
zzzzzzzzzzzzzzzzzzzzz
#! rnews 0
Newsgroups: xxx
From: xxx
Subject: xxx
Date: xxx
Xref: linux-nntp sybase.test:7
zzzzzzzzzzzzzzzzzzzzz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 10:44 AM
тАО12-17-2003 10:44 AM
Re: Help to split a file into multiple files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 10:54 AM
тАО12-17-2003 10:54 AM
Re: Help to split a file into multiple files
I am not expert in Shell scripts
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 11:29 AM
тАО12-17-2003 11:29 AM
Re: Help to split a file into multiple files
untested
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 11:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 12:10 PM
тАО12-17-2003 12:10 PM
Re: Help to split a file into multiple files
try this also.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 12:36 PM
тАО12-17-2003 12:36 PM
Re: Help to split a file into multiple files
my last solution had a little flaw.
It forgot the text of the news. :-(
try this one.
have fun,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2003 12:37 PM
тАО12-17-2003 12:37 PM
Re: Help to split a file into multiple files
I need help to do following in each file:
Each file has format:
#! rnews 0
Newsgroups: xxx
From: xxx
Subject: xxx
Date: xxx
Path: linux-nntp!forums-master!forums-1-dub!forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: linux-nntp sybase.test.xml:99
zzzzzzzzzzzzzzzzzzzzz
1)I need to replace "linux-nntp" in the line starting XRef: to "test".
2)I need to extract the number after sybase.text.xml from the line starting XRef: to a variable
3)Also I need to delete the text "linux-nntp!forums-master!" from the line starting "Path:"
Can soem one provide scripts for doing these operations.
Thanks