file - Cmd/batch how do I convert one line at a time in a .txt from one varable to an other -


i have document random letters in example

line 1: k
line 2: l
line 3: m
line 4: n

and want read 1 line , change letter have script using below.

if "%name%"=="k" (goto k) 

then have set new variable.

:k   set name=a   goto echo   

then have output other document using

:echo   echo %name%>>newvarables.txt   goto getinput 

is there way can convert lines of first document other variables based on system have already?

the following sample works windows nt systems!


for /f %%g in (filename.ext) call :function "%%~g" goto :eof  :function set skip=rem if "%~1"=="k" set name=a if "%~1"=="l" set name=m if not "%name%"=="" set skip= %skip% echo %name%>>filename2.ext exit /b 

loops through strings , process them, change suit need. code intended messy, that:

1 need put effort on understanding, not copy-paste code.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -