Skip to content
MSN

replace and text files

A TG007 community discussion started by DreaM.

Discussion 3 posts
Page 1 of 1
Open
Topic #2461 · 3 published posts · 1,135 views

guys I need help, I have test.txt and i want my script to scan the file and replace word: Blah by BLAH2 so how can I do it??

 

alias replace { 
var %i 1
while ($lines(test.txt) >= %i) {
<<<WHAT HERE>>>
}
inc %i
}

Edited Jan 10, 2005 12:56 AM by DreaM
alias replace { 
var %i 1
while ($lines(test.txt) >= %i) {
var %r = $read(test.txt,%i)
if (blah isin %r) /write -l $+ %i $replace(%r,blah,blah2)
}
inc %i
}

Edited Jan 10, 2005 3:45 AM by The Gate Keeper

alias replace { 
var %i 1
while ($lines(mirc.ini) >= %i) {
var %r = $read(mirc.ini,%i)
if (blah isin %r) /write -l $+ %i mirc.ini $replace(%r,blah,blah2)
inc %i
}
}

 

thank you gate and that is the code I am using now and I know well what I am trying to change in mirc.ini so dont worry guys lol but I have a problem:

 

[clicks]
status=/lusers
......=/channel
.
.

 

This / stops the alias from working and checking the whole file so can anyone explain to us why / stops the scaning and what is the solution??

Edited Jan 10, 2005 10:31 PM by DreaM