in reply to Read from multiple files change the data with a script and the write the respective output files with a different extension

Hello Akatsuki

you can use glob to collect all files you need. Then foreach file you are processing you can make up the name of the copy changing it's extension from .txt to .csv

Please note that Perl has many options to do such kind of operations with a single line of program: see perlrun and serch for -i -l -n switches. See Inplace Editing for a bunch of examples.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
  • Comment on Re: Read from multiple files change the data with a script and the write the respective output files with a different extension
  • Select or Download Code