Page 1 of 1

Search and Replace url

Posted: Sun Nov 14, 2010 4:08 pm
by WzevGIlK
The following maybe very easy to do but I cant seem to get it done. Please help!

List 1:
_http://www.google.com/search?q={url}
_http://www.yahoo.com/search?q={url}
_http://www.msn.com/search?q={url}
...

List 2 ({url}):
datamystic.com
datamystic.net
datamystic.org
....


How to Replace {url} whith every line from list 2:

_http://www.google.com/search?q=datamystic.com
_http://www.yahoo.com/search?q=datamystic.com
_http://www.msn.com/search?q=datamystic.com
_http://www.google.com/search?q=datamystic.net
_http://www.yahoo.com/search?q=datamystic.net
_http://www.msn.com/search?q=datamystic.net
_http://www.google.com/search?q=datamystic.org
_http://www.yahoo.com/search?q=datamystic.org
_http://www.msn.com/search?q=datamystic.org

Please help :roll:

Re: Search and Replace url

Posted: Mon Nov 15, 2010 7:33 am
by DataMystic Support
You can use VBScript or JScript to automate this. You'll need to modify this code so that the replace text for {url} is different each time the input file is processed.

Code: Select all

sub vb_build_filter( TPWindow )

dim f1,f2,f3,f4,f5,f6

TPWindow.startFilters
f1 = TPWindow.addReplaceFilter( "{url}", "***", 0, false, false, false, false, false, false, false, 0 )
TPWindow.endFilters

'File List:
TPWindow.clearAllFiles
TPWindow.addFile "**your filename here**", 0, 1

end sub   'End subroutine 


  Set vb_TextPipeApp = CreateObject("TextPipe.Application")
  Set vb_TPWindow = vb_TextPipeApp.newWindow
  if vb_TPWindow.execute = false then MsgBox "ERROR " & vbCrLF & vb_TPWindow.errorText