Hello all!
I'm having a hard time with a simple format problem,
I'm trying to breakup multiple large xml documents in
a directory into individual sections, then I split
them up and send to a different directory to get
processed. The problem I'm having is there is always a
blank line at the top of each page and the last page
after a large file is read is always blank.
Below is how I'm doing it, the delimiter </request> is
the very last piece of each one so when the program
sees that it writes a new file.
Any help would be greatly appreciated.
Dave
#!/usr/bin/perl -w
local $/ = '</request>'; # delimiter
my @xmlfiles = glob('*.xml'); #grab all .xml in dir
foreach my $xmlfile (@xmlfiles) {
open (TEST,"<$xmlfile");
while (<TEST>) {
open(OUTPUT, "> output.$.") # output.1, output.2,
etc
or die "output.$.: $!";
print OUTPUT;
close(OUTPUT);
}
}
__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs