I'd probably do it something like this. (Untested code...)
use strict; use warnings; use aliased 'Path::Class::Rule'; use Path::Class qw( dir file ); my $files = Rule->new->file->name(qr{\.txt$})->iter; while ( my $file = $files->() ) { (my $newfile = $file) =~ s/\.txt$/_new.txt/; $newfile = file($newfile); print "$file -> $newfile\n"; $newfile->spew( map { s/^(.*?)\.(.*?)\ (.*?)\.(.*?)\ (.*?)$/$1\t$2\t$4\t$5/; $_ } $file->slurp; ); }
In reply to Re: Processing multiple files
by tobyink
in thread Processing multiple files
by mocnii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |