I need to update one parameter in a large set of XML files. I read and use one perl line on the Windows command line, I can get it to do file permissions at a time, but I'm struggling to get perl to do all the files at once.
perl -pi.bak -e "s/(\d+\.\d+E-\d+)/2.2E-6/g;" test.xml
This works, however, when I try to change it to something like
perl -pi.bak -e "s/(\d+\.\d+E-\d+)/2.2E-6/g;" *.xml
I get "Can't open * .xml: Invalid argument"
perl -pi.bak -e "s/(\d+\.\d+E-\d+)/2.2E-6/g;" .xml
Gives me "Unable to open .xml: No such file or directory"
I tried to figure out if I could call it from another perl script using system (), however this does not seem to take into account the use of quotes and may not be the best way to do this.
Summary:
Problem. I have a large number of XML files inside which I want to change one parameter. I should be able to do this on a Windows machine, and ideally I would like to work on a solution that would allow me to automate this in a script so that I can cycle through numerous parameter substitutions (with a separate program that accepts the files that are being called. xml as input between replacements).
Thanks for any help you can offer.
source share