$5 reward for this Perl script (regular expression searches through an entire directory of files)

L

Luca Villa

*** I offer $5 via Paypal for the first working complete Perl script
***


I have thousands of files named like these:

c:\input\pumico-home.html
c:\input\ofofo-home.html
c:\input\cimaba-office.html
c:\input\plata-home.html
c:\input\plata-office.html
c:\input\zito-home.html

I need a Perl script that passes through both the categories of these
files (*-home.html and *-office.html) searching for some regular
expressions:

for *-home.html:
regexAone: abc\d+def
regexAtwo: lmn\d+ofg
regexAthree: pqr\d+stu

for *-office.html:
regexBone: artemis\d+lock
regexBtwo: pretamus\d+balim

It must output each regular expression match result to a txt file with
the same name as the input html file plus a suffix corresponding to
the name of the processed regular expression like above defined,
producing an output scenery like this:

c:\output\pumico-home-regexAone.txt
c:\output\pumico-home-regexAtwo.txt
c:\output\pumico-home-regexAthree.txt
c:\output\ofofo-home-regexAone.txt
c:\output\ofofo-home-regexAtwo.txt
c:\output\ofofo-home-regexAthree.txt
c:\output\cimaba-office-regexBone.txt
c:\output\cimaba-office-regexBtwo.txt
c:\output\plata-home-regexAone.txt
c:\output\plata-home-regexAtwo.txt
c:\output\plata-home-regexAthree.txt
c:\output\plata-office-regexBone.txt
c:\output\plata-office-regexBtwo.txt
c:\output\zito-home-regexAone.txt
c:\output\zito-home-regexAtwo.txt
c:\output\zito-home-regexAthree.txt

__________________

For example, supposing that the c:\input\cimaba-office.html file
contains the following 5 lines:
dfgdfsgdf
setertert
artemis123456lock
garumbzeta
pretamus9999balim
popolissss

c:\output\cimaba-office-regexBone.txt will be generated containing:
artemis123456lock

c:\output\cimaba-office-regexBtwo.txt will be generated containing:
pretamus9999balim


Thanks in advance
 
L

Luca Villa

(e-mail address removed) ha scritto:
Make it a $25 contribution to The Perl Foundation (via PayPal to
(e-mail address removed)), and send the submitter a copy of the receipt, and
you might get more interest. I might write it.

David, thanks for the suggestion!
This time I got it answered in another forum for $5 but next time I'll
really add the option to give the money to The Perl Foundation. Very
good idea!
Offer retracted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top