Batch processing-read and write files, string replacement

Bash language has been ported to windows dos, so many syntaxes are the same as linux shell.

For example, you can use <and> to read and write files. The concept of this stream is the same as that of the linux shell.

Code:

@echo off
set /p str1=<./in.txt
set str2=%str1:b=kk%
echo %str2% > out.txt
pause

Features:

Read in 1.txt, change b to kk, and finally output to out.txt

Guess you like

Origin blog.csdn.net/nameofcsdn/article/details/112299049