i think I'm getting lost in the iterations which is normal for me
i started out trying Find And Replace" (FAR) but never got it to work properly, perhaps due to the unusual characters.
I end up getting a working script using the Set command but hit problems when i tried to run it recursively over all 100+ text files in the folder while keeping the file names unchanged.
Each file is contains a single string repainting a URL and there are no spaces in the string. The domain portion of each has changed and tht is the only part i need to modify - replace the section that says "domain1.com" with "domain2.com" ,change nothing else and keep the original filename.
This has to be done to over a hundred urls stored as named text files in a master folder.
So far this is what i got:
for /f "tokens=1,* delims=ΒΆ" %%A in ( '"type *.txt"') do (
SET string=%%A
SET modified=!string:domain1.com=domain2.net!
echo !modified! >> out.txt
)
This works on a filename by filename basis but requires temporarily renaming the files while they are processed. I feel sure there is a way to walk the directory recursively and keep the filenames intact during the modification.
As written, the code above requires an infile and an outfile a bunch of renaming and is far more 'work" than should be needed.
I bet 4WD will have what I need right at hand if he is on line.
.
I would like for the result to be flexible enough to save the code for use on future projects where i might need to do something similar.
Thanks