Kvvinaykumar Posted March 17, 2013 Posted March 17, 2013 Hi, I would like to find the below line in Html file data-inset="false"> and replace with the below lines class="ui-li-thumb" /> class="ui-li-heading">Chase-Amazon_Appstore-uat-3.0.363.apk class="ui-li-desc">Chase-Amazon_Appstore-uat-3.0.363.apk using a batch file. so batch file should read the htmk file find the line and replace wih the given lines
ass17 Posted March 17, 2013 Posted March 17, 2013 I have done this in a VB script, can you use VB script as an alternative? Let me know and I will post it in full.
ass17 Posted March 17, 2013 Posted March 17, 2013 Const ForReading = 1 Const ForWriting = 2 set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Dim StringFind, StringReplace StringFind = "put your string in here to find" StringReplace = "put your replacement string in here" FileName = objFSO.GetFile("pathname and file name to file to look in") Set objFile = objFSO.OpenTextFile(FileName, ForReading) strContents = objFile.ReadAll objFile.Close If InStr(strContents,StringFind) then strContents = Replace(strContents, StringFind, StringReplace) Set objFile = objFSO.OpenTextFile(FileName, ForWriting) objFile.WriteLine strContents objFile.Close Else 'Do nothing End If
Kvvinaykumar Posted March 17, 2013 Author Posted March 17, 2013 Thnak you but looking for a working .bat batch file
featured_spectre Posted March 17, 2013 Posted March 17, 2013 So...you want a batch to do the following... open a file find a line in the file replace the line in the file save the file close the file rinse and repeat..think you would be better off with a VBScript tbh, as a batch is more for mapping things and services etc.
RabbieBurns Posted March 17, 2013 Posted March 17, 2013 notepad++ can do search and replace in multiple files http://notepad-plus-plus.org/download/v6.3.html
Kvvinaykumar Posted March 17, 2013 Author Posted March 17, 2013 Well,I already have a batch file with lots of scriptsand we need to append this as well to it.hence looking for the solution
RabbieBurns Posted March 17, 2013 Posted March 17, 2013 so add a line in the batch file which runs the vbs from above? 1
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