PC Review
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 CMD Promt
Re: replace line in txt file
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 CMD Promt
Re: replace line in txt file
![]() |
Re: replace line in txt file |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
On Thu, 3 Jul 2003 16:38:20 +0200, "Black" <radek.behavy@volny.cz> wrote:
>I need a batch file to change specified line in txt file. > >I have a file like this > >. >. >. >[win32client.dll] >comdll=sqlws32 >[win32client.ws32] >serverpath=SCentura,192.168.1.3,2155/* >. >. >. > > >and I need a batch file to replace line >"serverpath=SCentura,192.168.1.3,2155/*" to >"serverpath=SCentura,888.888.888.888,2155/*" > >Can somebody help me? @echo off setlocal set filename=c:\folder\filename.xxx (the full path to your file) if exist %TEMP%\replace.tmp del /q %TEMP%\replace.tmp for /f "Tokens=*" %%a in ('type %filename%') do set line=%%a&call arsedel /q %filename% copy %TEMP%\replace.tmp %filename% del /q %TEMP%\replace.tmp endlocal goto :EOF arseset work=%line:"=% if /i "%work%" EQU "serverpath=SCentura,192.168.1.3,2155/*" goto replace ut@echo %line%>>%TEMP%\replace.tmp goto :EOF :replace set line="serverpath=SCentura,888.888.888.888,2155/*" goto out Jerold Schulman Windows: General MVP JSI, Inc. http://www.jsiinc.com |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 
arse
ut
