dman Posted April 3, 2005 Share Posted April 3, 2005 @clavicleyay! that's what I like to hear. Glad I could help Link to comment Share on other sites More sharing options...
jaclaz Posted April 3, 2005 Share Posted April 3, 2005 @clavicleyep, if you have problems, just post here the batch you made and I'll see what I can do.jaclaz Link to comment Share on other sites More sharing options...
gareththegod Posted May 2, 2005 Share Posted May 2, 2005 This should work for any text file.replace "path\textfile" with the path and name of your original file.replace "originaltext" with the text you want to replace.replace "newtext" with the text you want instead.for /f %%L in (path\textfile) DO ( if "%%L"=="originaltext" ( echo newtext>>path\temp.TMP ) ELSE ( echo %%L>>path\temp.TMP ))copy /Y path\temp.TMP path\textfile<{POST_SNAPBACK}>I have tried to make a batch file that searches an extracted help file webpage rename it to a text. Then do a find and replace the links in the string. CMD file is called 2 in the attached zip file.@echo offSetlocalset NAME=ntcmdsset FOLDER=cmdsecho Deleting old folder if exists.IF EXIST %NAME% RD /S /Q %NAME%Echo Decompiling %NAME% Help filehh.exe -decompile .\%NAME%\ %WINDIR%\Help\%NAME%.chmEcho Moving all other files to %FOLDER%md %NAME%\%FOLDER%cd %NAME%move *.* %FOLDER%Move .\%FOLDER%\%NAME%.htm .\%NAME%.htmren %NAME%.htm %NAME%.txtfind "MS-ITS:%NAME%.chm::/" %NAME%.txt /cThe last line of the code is what I want to find and replace. I Then removed it and added see below.I wanted to change the links in the webpage to see the wepages in the folder below it.for /f %%L in (%NAME%.txt) DO (if "%%L"=="MS-ITS:%NAME%.chm::/" ( echo %FOLDER%\>>.\temp.TMP) ELSE ( echo %%L>>.\temp.TMP))copy /Y temp.TMP %NAME%.txtI used the code above to changed the find and replace to be what I want to replace etc.find = MS-ITS:%NAME%.chm::/Replace with = %FOLDER%\ or cmds\ but prefer to use the varibleBut it doesn't work all that is in the temp file is the first few charaters from each line.I don't know much about the for command and would like help in understanding it. Link to comment Share on other sites More sharing options...
tittoproject Posted August 2, 2005 Share Posted August 2, 2005 Is it possible to replace some strings contained between two other ones? For example: BEGINstringEND --> BEGINnew_stringENDThanks Link to comment Share on other sites More sharing options...
Eki Posted August 2, 2005 Share Posted August 2, 2005 How Can I Find and Replace Text in a Text File? Link to comment Share on other sites More sharing options...
akira6968 Posted November 14, 2010 Share Posted November 14, 2010 Found that the link for the VFP6 Runtimes is broken (for dman's utility).... had a hard time finding VFP6 runtimes....not sure if it HAS to be 6, but just in case, here is a link to VFP6-9 runtime installers I found.http://code.msdn.microsoft.com/FoxPro/Release/ProjectReleases.aspx?ReleaseId=125 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now