M
Mr_Noob
Hi all,
I try to write a perl script that would delete all non xml complient
lines (ie beginning with "<" and ending ">").
Here is what i succeded to put down so far :
sub delete_non_xml_lines
{
my $search = new File::List($xmldir);
my @files = @{ $search->find("textfile") };
foreach (@files)
{
my $file = $_;
open(FILE, "< $file") or die "Can't open $file : $!";
while(<FILE>)
{
print if $_ =~ />$/;
}
close FILE;
}
}
But how can I redirect the output for each processed file into an xml
file ?
thanks in advance for helping
Regards
I try to write a perl script that would delete all non xml complient
lines (ie beginning with "<" and ending ">").
Here is what i succeded to put down so far :
sub delete_non_xml_lines
{
my $search = new File::List($xmldir);
my @files = @{ $search->find("textfile") };
foreach (@files)
{
my $file = $_;
open(FILE, "< $file") or die "Can't open $file : $!";
while(<FILE>)
{
print if $_ =~ />$/;
}
close FILE;
}
}
But how can I redirect the output for each processed file into an xml
file ?
thanks in advance for helping
Regards