We have around 1000 scripts in a specific folder like mcx001.txt, mcx002.txt, mcx999.txt, mce001.txt etc
We need to rename those files where 3rd character is "x" and should be replaced by "y".
So files should be renamed to mcy001.txt, mcy002.txt, mcy999.txt
Also, mcx001.txt have content "filename=mcx001" which also needs to be renamed to "filename=mcy001".
This applies to all the files which have 3rd character as "x".
There's no w nor d in your first specification - I reckon you mean x and y ? And, you don't seem to care for the character position, a w in any position will make that respective file a candidate for the modifications.