Search and Replace url

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Search and Replace url

Postby WzevGIlK » Sun Nov 14, 2010 4:08 pm

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: 2164
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Search and Replace url

Postby DataMystic Support » Mon Nov 15, 2010 7:33 am

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

Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest