Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Batch processing files in a directory

by Kenosis (Priest)
on Feb 13, 2013 at 20:47 UTC ( #1018632=note: print w/ replies, xml ) Need Help??


in reply to Batch processing files in a directory

Here's another option:

use strict; use warnings; for my $file (<*.ptseq>) { my ($baseName) = $file =~ /^(.+)\.[^.]+$/; my $textFile1 = $baseName . '1.txt'; my $textFile2 = $baseName . '2.txt'; print "$file ->\t$textFile1\t$textFile2", "\n"; }

Output from my dir:

fileA.ptseq -> fileA1.txt fileA2.txt fileB.ptseq -> fileB1.txt fileB2.txt fileC.ptseq -> fileC1.txt fileC2.txt fileD.ptseq -> fileD1.txt fileD2.txt


Comment on Re: Batch processing files in a directory
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018632]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2015-07-02 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (27 votes), past polls