mIRC Homepage
Posted By: sorex write -dl+string question - 25/08/03 05:29 AM
hello,

how would delete a line in a text file based on a variable that hold the line number to be deleted?

/write -dl%rlinenr filename.txt

doesn't seem to work
Posted By: Collective Re: write -dl+string question - 25/08/03 05:37 AM
/write -dl $+ %rlinenr filename.txt
Posted By: MrPeepers Re: write -dl+string question - 25/08/03 05:39 AM
/write -d%d filename.txt
assuming you set the variable to %d
Posted By: MrPeepers Re: write -dl+string question - 25/08/03 05:39 AM
I'd use collectives his is better
Posted By: Collective Re: write -dl+string question - 25/08/03 05:39 AM
That doesn't work, please test your code before posting it.
Posted By: MrPeepers Re: write -dl+string question - 25/08/03 05:40 AM
It is tested it currently works in my mirc under my scripts
Posted By: Collective Re: write -dl+string question - 25/08/03 05:45 AM
Code:
alias wrong {
  write test.txt a
  write test.txt b
  write test.txt c
  set %d 2
  write -d%d test.txt
  run test.txt
}

Will give you:
a
b

which is wrong, it should give you:
a
c

which mine does. Yours always deletes the last line, that isn't what he wants.
Posted By: sorex Re: write -dl+string question - 25/08/03 08:37 AM
sorry for the late response but I forgot my password which I needed to enter on this machine that didn't have the cookie yet.

anyway thanks for the replies, I'll try them out when I'm at home.

btw, didn't even know about that $+ thingy but according to the mIRC help that should do the trick.
Posted By: sorex Re: write -dl+string question - 26/08/03 06:54 AM
works great guys smile
© mIRC Discussion Forums