mIRC Home    About    Download    Register    News    Help

Print Thread
write -dl+string question #44010 25/08/03 05:29 AM
Joined: Apr 2003
Posts: 17
S
sorex Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Apr 2003
Posts: 17
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

Re: write -dl+string question #44011 25/08/03 05:37 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/write -dl $+ %rlinenr filename.txt

Re: write -dl+string question #44012 25/08/03 05:39 AM
Joined: Aug 2003
Posts: 136
MrPeepers Offline
Vogon poet
Offline
Vogon poet
Joined: Aug 2003
Posts: 136
/write -d%d filename.txt
assuming you set the variable to %d


In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
Re: write -dl+string question #44013 25/08/03 05:39 AM
Joined: Aug 2003
Posts: 136
MrPeepers Offline
Vogon poet
Offline
Vogon poet
Joined: Aug 2003
Posts: 136
I'd use collectives his is better


In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
Re: write -dl+string question #44014 25/08/03 05:39 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
That doesn't work, please test your code before posting it.

Re: write -dl+string question #44015 25/08/03 05:40 AM
Joined: Aug 2003
Posts: 136
MrPeepers Offline
Vogon poet
Offline
Vogon poet
Joined: Aug 2003
Posts: 136
It is tested it currently works in my mirc under my scripts


In Virginia, chickens cannot lay eggs before 8:00 a.m., and must be done before 4:00 p.m.
Re: write -dl+string question #44016 25/08/03 05:45 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

Re: write -dl+string question #44017 25/08/03 08:37 AM
Joined: Apr 2003
Posts: 17
S
sorex Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Apr 2003
Posts: 17
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.

Re: write -dl+string question #44018 26/08/03 06:54 AM
Joined: Apr 2003
Posts: 17
S
sorex Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Apr 2003
Posts: 17
works great guys smile