Search and Replace url

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
WzevGIlK
Posts: 10
Joined: Tue Mar 16, 2010 11:32 pm
Contact:

Search and Replace url

Post 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:
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Search and Replace url

Post 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

Post Reply