in reply to Re: Run a perl code on all input files and have the results in different output files
in thread Run a perl code on all input files and have the results in different output files

Is it possible to share the edited code with me,I didn't get unfortunately. yes, I need tap3. This code perfectly goes fine for one file, I just want to give a batch of similar code and input and get the outputs.
  • Comment on Re^2: Run a perl code on all input files and have the results in different output files

Replies are listed 'Best First'.
Re^3: Run a perl code on all input files and have the results in different output files
by bliako (Abbot) on May 12, 2020 at 09:40 UTC
    my $filename="Taps/Output.xml"; my $fh; open($fh, '>:encoding(UTF-8)', $filename) or die "file, $!"; foreach my $file(glob 'Taps/DA*') { my $tap3 = TAP3::Tap3edit->new(); $files= basename($file); #<< are you sure this is needed/does it wo +rk? $tap3->decode($files) || die $tap3->error; print $fh $dump->pl2xml($tap3->structure); } close $fh;

    WARNING: This code reads just ONE tap file, decodes it and dumps it. It does that for all TAP files. Separately. I am not sure you will get correct output, because I am not sure you want to read and decode all files first or decode and dump each separately, as above code does.