need macro to generate text files

I have a plain text file which I need to, on a daily basis, convert into several additional versions. The document(s) contains setting for systems and I need to have three versions, all derived from the master.

Ideally I need an automated process (macro?) run each morning at 3AM and generate the other versions.

I have a folder (Settings) in which the .txt file exists (settings.txt). I need the following changes to be made to 'auto-generate' two additional variants (settings2.txt and settings3.txt) from it. So, the folder will at all times have a settings, settins2 and setting3 file within it, with settings2 and settings3 re-generated each morning from the settings file that exists when the macro runs.

The changes, to keep it simply, are to take the settings.txt file and make several replacements. For example, replace all instance of 'Apple' with 'Pear', 'Dog' with 'Cat' and 'House' with 'Car'. The different file versions are used by different systems that share settings but need to be in a different format, hence the need to make changes.

Probably more information than is needed but in case the replacements above confuse. A real example is that in settings.txt there are MANY lines that read 'feed=2,5,F,' and they need to be switched out in settings2.txt to be 'feed=3,2,G,' and in settings3.txt to 'feed=1,2,F,'. Hope that helps.

Is there a system (maybe even inherent within Window 7?) that will auto-generate these text files for me or a 3rd party product etc?
Who is Participating?
ozoConnect With a Mentor Commented:
perl -pe "s/Apple/Pear/g; s/Dog/Cat/g; s/House/Car/g;" <  settings.txt > settings2.txt
ccapitalAuthor Commented:
Sorry but this really isn't clear to me. How will this run on an automated basis and where/how do I enter this command?

I am running Windows 7 OS. Is an add-on needed?
ccapitalAuthor Commented:
Actually, a little legwork and I see now what to do. Installed Perl and that runs fine. Is there a way I can run a perl command automatically in Windows Scheduler?
ccapitalAuthor Commented:
Managed to get this running via scheduler through a .bat file. Many thanks,
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.