Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Using perl to extract data from multiple .txt files

by choroba (Chancellor)
on Nov 14, 2012 at 15:27 UTC ( #1003834=note: print w/ replies, xml ) Need Help??


in reply to Using perl to extract data from multiple .txt files

open my $OUT, '>', 'output.txt' or die "output: $!"; for my $file (glob 'dir/*.txt') { # Your old code here. Remove opening the output file. }
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Using perl to extract data from multiple .txt files
by MidLifeXis (Monsignor) on Nov 14, 2012 at 15:46 UTC

    Careful with this one to make sure that you (the OP, not choroba) do not process the text file opened above.

    --MidLifeXis

      True. I added a path to the code (I had planned to, but forgot).
      لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2016-08-28 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (390 votes). Check out past polls.