mIRC Home    About    Download    Register    News    Help

Print Thread
A
acemiles_ed
acemiles_ed
A
What is the best way to split a line pulled from an on input script ($1-) to be split to two differant external files (via /write). The split will occur when an 'http://' occurs.

i.e.:
<MyUser> Go read this web site at http://www.random-nonexistant-site.com

Text1.txt "Go read this web site at"
Text2.txt " http://www.random-nonexistant-site.com"

Any ideas?

Joined: Jan 2003
Posts: 149
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 149
/help $wildtok

Code:
$wildtok(&lt;MyUser&gt; Go read this web site at http://www.random-nonexistant-site.com, http://*, 1, 32)


grin

A
acemiles_ed
acemiles_ed
A
Thanks, that helps for the URL text file, but what about removing the URL for the Regular text file?

Merci.

Joined: Jan 2003
Posts: 149
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 149
smth like

Code:
alias urltest {
  var %in = &lt;MyUser&gt; Go read this web site at http://www.random-nonexistant-site.com
  var %url = $wildtok(%in, http://*, 1, 32)
  var %g = $findtok(%in,%url,1,32)
  return $gettok(%in,1- $+ $calc(%g - 1),32)
}

Joined: Jan 2003
Posts: 149
J
Vogon poet
Offline
Vogon poet
J
Joined: Jan 2003
Posts: 149
heh... need to get some sleep grin

Code:
alias urltest {
  var %in = &lt;MyUser&gt; Go read this web site at http://www.random-nonexistant-site.com
  var %url = $wildtok(%in, http://*, 1, 32)
  var %g = $findtok(%in,%url,1,32)
  return $remtok(%in,%url,1,32)
}


a better way...

then u can make smth like

Code:
alias lurl { return $remtok($1-,$wildtok($1-, http://*, 1, 32),1,32) }
alias rurl { return $wildtok($1-, http://*, 1, 32) }

Last edited by J0ke; 05/09/03 09:44 PM.

Link Copied to Clipboard