mIRC Home    About    Download    Register    News    Help

Print Thread
#7511 20/01/03 10:51 AM
Joined: Jan 2003
Posts: 2
O
owenw Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
O
Joined: Jan 2003
Posts: 2
Hi guys.

I am using the /write command in a script to try and remove a blank line from a file. I wrote a small loop which counts the lines until it finds a blank one (=$null) and then I'm trying to delete the line using:

/write -dl%linecount c:\file.txt

The problem is the script is deleting the first line in the file, and not the one I want it to. Does anyone have any ideas? Help would be much appreciated. Thanks.

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Use: /write -dl $+ %linecount c:\file.txt

I'd use the /filter command instead, to get it working more efficiently, but looks like it has a bug. I can't get it to work:

//filter -cxff file.txt file.txt $crlf

It should take out any blank line ($crlf), but it doesn't. no idea why...

Joined: Jan 2003
Posts: 20
H
Ameglian cow
Offline
Ameglian cow
H
Joined: Jan 2003
Posts: 20
It seems, reading and writing from and to one and the same file is not implemented. It works fine for me, when using it from file A to file B, but not from file B to file B. A workaround might be to save the output (without blank lines) to a temporary file.
It could be a bug - or a feature grin

--hatch

Last edited by hatch; 20/01/03 12:39 PM.

__________________
"Who cares. Out of sight, out of mind."
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
nah, the help file states clearly:

Note: If the input and output are the same window/file, mIRC will process the request correctly.

Must be a bug then.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Yes, it's a bug, I came across it one day too. Eventually I used /filter -ffcg file.txt file.txt /\S/


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard