Sponsored Content
Top Forums Shell Programming and Scripting Split large zone file dump into multiple files Post 302583749 by Bluemerlin on Wednesday 21st of December 2011 07:56:56 AM
Old 12-21-2011
Quote:
Originally Posted by Franklin52
Another approach:

Code:
awk '/; DNS/{f=$(NF-1)}{print > f}' file

Thanks,

If it's not asking too much, could you explain this to me as I would like to understand and learn rather than just asking for another script for my next endeavor.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to divide single large log file into multiple files.

Can you please help me with writing script for following purpose. I have to divide single large web access log file into multiple log files based on dates inside the log file. For example: if data is logged in the access file for jan-10-08 , jan-11-08 , Jan-12-08 then make small log file... (1 Reply)
Discussion started by: kamleshm
1 Replies

2. Shell Programming and Scripting

Copy large dump file

Hi Experts.. Could anyone please let me know the easier way to copy large dump of files from one server to another. I am trying to copy a set of dump files on two different servers placed in different geographic locations.. Though there are other factors such as latency, etc., slowing up the... (4 Replies)
Discussion started by: ganga.dharan
4 Replies

3. Shell Programming and Scripting

Split large file and add header and footer to each small files

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (7 Replies)
Discussion started by: ashish4422
7 Replies

4. UNIX for Dummies Questions & Answers

multiple smaller files from one large file

I have a file with a simple list of ids. 750,000 rows. I have to break it down into multiple 50,000 row files to submit in a batch process.. Is there an easy script I could write to accomplish this task? (2 Replies)
Discussion started by: rtroscianecki
2 Replies

5. Solaris

Solaris 10 zone crash dump file?

Hi, I'm running Solaris 10 with a zone called "testzone" If I do a "reboot -d" on the host, as expected the kernet panics, reboots and creates a crash dump file in /var/crash However no crash file is created in testzone. My question is how can I tell if a zone crashs or shuts down... (4 Replies)
Discussion started by: fastexit
4 Replies

6. Shell Programming and Scripting

Help needed - Split large file into smaller files based on pattern match

Help needed urgently please. I have a large file - a few hundred thousand lines. Sample CP START ACCOUNT 1234556 name 1 CP END ACCOUNT CP START ACCOUNT 2224444 name 1 CP END ACCOUNT CP START ACCOUNT 333344444 name 1 CP END ACCOUNT I need to split this file each time "CP START... (7 Replies)
Discussion started by: frustrated1
7 Replies

7. Linux

Split a large textfile (one file) into multiple file to base on ^L

Hi, Anyone can help, I have a large textfile (one file), and I need to split into multiple file to break each file into ^L. My textfile ========== abc company abc address abc contact ^L my company my address my contact my skills ^L your company your address ========== (3 Replies)
Discussion started by: fspalero
3 Replies

8. UNIX for Beginners Questions & Answers

Split large file into smaller files without disturbing the entry chunks

Dears, Need you help with the below file manipulation. I want to split the file into 8 smaller files but without cutting/disturbing the entries (meaning every small file should start with a entry and end with an empty line). It will be helpful if you can provide a one liner command for this... (12 Replies)
Discussion started by: Kamesh G
12 Replies

9. Shell Programming and Scripting

Split large xml into mutiple files and with header and footer in file

Split large xml into mutiple files and with header and footer in file tried below it splits unevenly and also i need help in adding header and footer command : csplit -s -k -f my_XML_split.xml extrfile.xml "/<Document>/" {1} sample xml <?xml version="1.0" encoding="UTF-8"?><Recipient>... (36 Replies)
Discussion started by: karthik
36 Replies

10. UNIX for Beginners Questions & Answers

Split large file into 24 small files on one hour basis

I Have a large file with 24hrs log in the below format.i need to split the large file in to 24 small files on one hour based.i.e ex:from 09:55 to 10:55,10:55-11:55 can any one help me on this.! ... (20 Replies)
Discussion started by: Raghuram717
20 Replies
Net::DNS::ZoneFile(3)					User Contributed Perl Documentation				     Net::DNS::ZoneFile(3)

NAME
Net::DNS::ZoneFile - DNS zone file SYNOPSIS
use Net::DNS::ZoneFile; $zonefile = new Net::DNS::ZoneFile( 'named.example' ); while ( $rr = $zonefile->read ) { $rr->print; } @zone = $zonefile->read; DESCRIPTION
Each Net::DNS::ZoneFile object instance represents a zone file together with any subordinate files introduced by the $INCLUDE directive. Zone file syntax is defined by RFC1035. A program may have multiple zone file objects, each maintaining its own independent parser state information. The parser supports both the $TTL directive defined by RFC2308 and the BIND $GENERATE syntax extension. All RRs in a zone file must have the same class, which may be specified for the first RR encountered and is then propagated automatically to all subsequent records. METHODS
new $zonefile = new Net::DNS::ZoneFile( 'filename', ['example.com'] ); $handle = new FileHandle( 'filename', '<:encoding(ISO8859-7)' ); $zonefile = new Net::DNS::ZoneFile( $handle, ['example.com'] ); The new() constructor returns a Net::DNS::ZoneFile object which represents the zone file specified in the argument list. The specified file or file handle is open for reading and closed when exhausted or all references to the ZoneFile object cease to exist. The optional second argument specifies $ORIGIN for the zone file. Character encoding is specified indirectly by creating a FileHandle with the desired encoding layer, which is then passed as an argument to new(). The specified encoding is propagated to files introduced by $include directives. read $rr = $zonefile->read; @rr = $zonefile->read; When invoked in scalar context, read() returns a Net::DNS::RR object representing the next resource record encountered in the zone file, or undefined if end of data has been reached. When invoked in list context, read() returns the list of Net::DNS::RR objects in the order that they appear in the zone file. Comments and blank lines are silently disregarded. $INCLUDE, $ORIGIN, $TTL and $GENERATE directives are processed transparently. name $filename = $zonefile->name; Returns the name of the zone file from which RRs will be read. $INCLUDE directives will cause this to differ from the filename argument supplied when the object was created. line $line = $zonefile->line; Returns the number of the last line read from the current zone file. origin $origin = $zonefile->origin; Returns the fully qualified name of the current origin within the zone file. ttl $ttl = $zonefile->ttl; Returns the default TTL as specified by the $TTL directive. COMPATIBILITY WITH Net::DNS::ZoneFile 1.04 Applications which depended on the defunct Net::DNS::ZoneFile 1.04 CPAN distribution will continue to operate with minimal change using the compatibility interface described below. use Net::DNS::ZoneFile; $listref = Net::DNS::ZoneFile->read( $filename, $include_dir ); $listref = Net::DNS::ZoneFile->readfh( $handle, $include_dir ); $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); $_->print for @$listref; The optional second argument specifies the default path for filenames. The current working directory is used by default. Although not available in the original implementation, the RR list can be obtained directly by calling any of these methods in list context. @rr = Net::DNS::ZoneFile->read( $filename, $include_dir ); read $listref = Net::DNS::ZoneFile->read( $filename, $include_dir ); @rr = Net::DNS::ZoneFile->read( $filename, $include_dir ); read() parses the specified zone file and returns a reference to the list of Net::DNS::RR objects representing the RRs in the file. The return value is undefined if the zone data can not be parsed. When called in list context, the partial result is returned if an error is encountered by the parser. readfh $listref = Net::DNS::ZoneFile->readfh( $handle, $include_dir ); readfh() parses data from the specified file handle and returns a reference to the list of Net::DNS::RR objects representing the RRs in the file. parse $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); $listref = Net::DNS::ZoneFile->parse( $string, $include_dir ); parse() interprets the zone file text in the argument string and returns a reference to the list of Net::DNS::RR objects representing the RRs. ACKNOWLEDGEMENTS
This package is designed as an improved and compatible replacement for Net::DNS::ZoneFile 1.04 which was created by Luis Munoz in 2002 as a separate CPAN module. The present implementation is the result of an agreement to merge our two different approaches into one package integrated into Net::DNS. The contribution of Luis Munoz is gratefully acknowledged. Thanks are also due to Willem Toorop for his constructive criticism of the initial version and invaluable assistance during testing. COPYRIGHT
Copyright (c)2011-2012 Dick Franks All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
perl, Net::DNS, Net::DNS::RR, RFC1035 Section 5.1, RFC2308, BIND 9 Administrator Reference Manual perl v5.18.2 2014-01-16 Net::DNS::ZoneFile(3)
All times are GMT -4. The time now is 07:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy