ファイル名を引数として受け取る.cmdファイルを作成し、検索する文字列と置き換える文字列を要求します。
希望のアウトプット
findthis は指定されたファイルから replacewith に置き換える必要がありますが、機能していません
以下は私が試したコードです..
@echo off
setlocal enabledelayedexpansion
if not exist "%1" (echo this file does not exist...)&goto :eof
set /p findthis=find this text string:
set /p replacewith=and replace it with this:
for /f "tokens=*" %%a in (%1) do (
set write=%%a
if %%a==%findthis% set write=%replacewith%
echo !write!
echo !write! >>%~n1.replaced%~x1
)
ありがとう