- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Header and Trailer Records
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
Forums
Discussions
Discussions
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
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
04-04-2006 10:38 AM
04-04-2006 10:38 AM
I have a datafile with header and trailer records...i want to remove header and trailer records and move rest of the contents to new file ... Since size is huge (arround 3-4GB) pls let me know which is the best way to do this ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 10:57 AM
04-04-2006 10:57 AM
Re: Header and Trailer Records
A better option would be a small C program or a Perl script. Perl is capable of reading binary data so this would be a straightforward exercise in either C or Perl provided that you know the data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 10:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 11:01 AM
04-04-2006 11:01 AM
Re: Header and Trailer Records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 11:07 AM
04-04-2006 11:07 AM
Re: Header and Trailer Records
Another way is to use regular expressions to match records (assuming a line-oriented, text file) and discard what you define as a "header" or a "trailer". For example to discard the interpreter line of a shell script and a last line that says "exit", do:
# perl -ne 'print unless m/bin\/sh|^exit/' filein
This prints everything that isn't "bin/sh" or "exit" anchored to the beginning of a line.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2006 12:34 PM
04-04-2006 12:34 PM
Re: Header and Trailer Records
This worked for me.
# sed -e '1'd -e '$'d filein > fileout