Environment
Windows 10,
C:\Folder_With_VMXfiles,
installed sed for windows
Tools: Batch script, sed for Windows
Requirements:
In folder C:\Folder_With_VMXfiles Need to replace some text inside the vmx files with another. But the replacing text is specific to every .vmx file.
Example:
- VMX file 1 has string "COM2" inside and want to replace it with "COM33"
- VMX file 2 has string "COM3" inside and want to replace with "COM34"
I tried to do with nested for loops but i could get the desired results. Basically i need to loop through the directory , select the ".vmx" files and use sed to replace text.
Tried:
@echo off
for /f %%i in ("Folder_With_VMXfiles") do (
echo %%i
for /l %%j in (1,1,9) do (
sed -i "s/COM/COM%%j/" %%i )
)