Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 chanting in the Monastery: (6)
As of 2014-07-31 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls