Sorry I should have tried my code on more than 1 large URL as I have forgotten to reset the bytes variable please accept this updated version:
Hi Chubler_XL,
I tried out your code snippet. There're a couple of observations that I made.
Firstly, the splitted files are being generated, but the sizelimit is not being considered as that in the parameter file, but the size of the initial file itself. For e.g., suppose the initial file ("output") was created with size 324010 bytes, whereas the parameter file specified the size limit of 10240 bytes. However there are two files created by the script, one is "output" (the initial file) with size 324010 bytes, and "output.2" with size 324017, both with the same data.
I guess there might be something amiss with the bytes variable assignment, but I'm not sure.
Secondly, just for my knowledge, is your script supposedly appending </URL> to the end of every file that gets generated?
Hello gurus,
I am new to "awk" and trying to break a large file having 4 million records into several output files each having half million but at the same time I want to keep the similar key records in the same output file, not to exist accross the files.
e.g. my data is like:
Row_Num,... (6 Replies)
I need to write a shell script for below scenario
My input file has data in format:
qwerty0101TWE 12345 01022005 01022005 datainala alanfernanded 26
qwerty0101mXZ 12349 01022005 06022008 datainalb johngalilo 28
qwerty0101TWE 12342 01022005 07022009 datainalc hitalbert 43
qwerty0101CFG 12345... (19 Replies)
Hi Experts,
I have to split huge file based on the pattern to create smaller files. The pattern which is expected in the file is:
Master.....
First...
second....
second...
third..
third...
Master...
First..
second...
third...
Master...
First...
second..
second..
second..... (2 Replies)
I am trying to update an older program on a small cluster. It uses individual files to send jobs to each node. However the newer database comes as one large file, containing over 10,000 records. I therefore need to split this file. It looks like this:
HMMER3/b
NAME 1-cysPrx_C
ACC ... (2 Replies)
HI All,
I have to split a xml file into multiple xml files and append it in another .xml file. for example below is a sample xml and using shell script i have to split it into three xml files and append all the three xmls in a .xml file. Can some one help plz.
eg:
<?xml version="1.0"?>... (4 Replies)
I will simplify the explaination a bit, I need to parse through a 87m file -
I have a single text file in the form of :
<NAME>house........
SOMETEXT
SOMETEXT
SOMETEXT
.
.
.
.
</script>
MORETEXT
MORETEXT
.
.
. (6 Replies)
Hello All ,
Please help me with below requirement
I want to split a xml file based on tag.here is the file format
<data-set>
some-information
</data-set>
<data-set1>
some-information
</data-set1>
<data-set2>
some-information
</data-set2>
I want to split the above file into 3... (5 Replies)
Hi Everyone,
I'm new here and I was checking this old post:
/shell-programming-and-scripting/180669-splitting-file-into-several-smaller-files-using-perl.html
(cannot paste link because of lack of points)
I need to do something like this but understand very little of perl.
I also check... (4 Replies)
Hi,
I'm having a xml file with multiple xml header. so i want to split the file into multiple files.
Sample.xml consists multiple headers so how can we split these multiple headers into multiple files in unix.
eg :
<?xml version="1.0" encoding="UTF-8"?>
<ml:individual... (3 Replies)
SAX::PurePerl(3) User Contributed Perl Documentation SAX::PurePerl(3)NAME
XML::SAX::PurePerl - Pure Perl XML Parser with SAX2 interface
SYNOPSIS
use XML::Handler::Foo;
use XML::SAX::PurePerl;
my $handler = XML::Handler::Foo->new();
my $parser = XML::SAX::PurePerl->new(Handler => $handler);
$parser->parse_uri("myfile.xml");
DESCRIPTION
This module implements an XML parser in pure perl. It is written around the upcoming perl 5.8's unicode support and support for multiple
document encodings (using the PerlIO layer), however it has been ported to work with ASCII/UTF8 documents under lower perl versions.
The SAX2 API is described in detail at http://sourceforge.net/projects/perl-xml/, in the CVS archive, under libxml-perl/docs. Hopefully
those documents will be in a better location soon.
Please refer to the SAX2 documentation for how to use this module - it is merely a front end to SAX2, and implements nothing that is not in
that spec (or at least tries not to - please email me if you find errors in this implementation).
BUGS
XML::SAX::PurePerl is slow. Very slow. I suggest you use something else in fact. However it is great as a fallback parser for XML::SAX,
where the user might not be able to install an XS based parser or C library.
Currently lots, probably. At the moment the weakest area is parsing DOCTYPE declarations, though the code is in place to start doing this.
Also parsing parameter entity references is causing me much confusion, since it's not exactly what I would call trivial, or well documented
in the XML grammar. XML documents with internal subsets are likely to fail.
I am however trying to work towards full conformance using the Oasis test suite.
AUTHOR
Matt Sergeant, matt@sergeant.org. Copyright 2001.
Please report all bugs to the Perl-XML mailing list at perl-xml@listserv.activestate.com.
LICENSE
This is free software. You may use it or redistribute it under the same terms as Perl 5.7.2 itself.
perl v5.16.2 2011-09-04 SAX::PurePerl(3)