mIRC Homepage
Posted By: lightdarkness Delete one line of textfile - 17/01/06 10:27 PM
I'm trying to delete any line in a text file with certain text, and here's what I have:

write $+(-dw*,mydeleteword,*) mytextfile.txt

The only problem is, whenever a line is found with that phrase, it deletes the entire file! How can I make it only delete the one line.
Posted By: schaefer31 Re: Delete one line of textfile - 17/01/06 10:57 PM
/write -dw*matchtext* mytextfile.txt
Posted By: MikeChat Re: Delete one line of textfile - 17/01/06 11:03 PM
first off
write $+( -dw*,mydeleteword,*) mytextfile.txt

the -dw doesn't belong inside the $+()
Posted By: lightdarkness Re: Delete one line of textfile - 17/01/06 11:19 PM
That worked perfectly! But I have another problem!

More than one instance of my search text exsists in the file, how do I delete all of them, not just one.
Posted By: MikeChat Re: Delete one line of textfile - 18/01/06 02:15 AM
/filter

if your file is named test.txt it would be like this
//filter -ffcx test.txt test.txt *matchtext*

/help /filter

there is a lot of options that you can use
© mIRC Discussion Forums