mIRC Home    About    Download    Register    News    Help

Print Thread
#62265 29/11/03 10:44 PM
Joined: Dec 2002
Posts: 56
Babel fish
OP Offline
Babel fish
Joined: Dec 2002
Posts: 56
I have made an mts engine and I load the theme into a window, and some themes have spaces in them like:
MTSVersion 1.1
Script enigma.mrc

Timestamp ON
TimestampFormat 12[13h11:13nn12]

I tried removing this by using the filter command:
filter -cwwx %t.w_s %t.w_s $crlf <- Didn´t work
filter -cwwx %t.w_s %t.w_s $crlf $+ * <- Didn´t work
filter -cwwx %t.w_s %t.w_s * $+ $crlf $+ * <- Didn´t work

How can I remove the $crlf lines if filter doesn´t do the job right???




#62266 30/11/03 02:55 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
/filter -cffx infile outfile $crlf is indeed buggy (it does nothing), but your problem is not related to this bug. You're dealing with custom windows, where there can be no empty lines. The blank lines you see in custom windows when you /loadbuf a file with empty lines aren't actually empty; they consist of a single space. You can quickly verify this with
//echo -s $replace($line(%t.w_s,3),$chr(32),@)
You should see a "@" echoed in Status.

So, to filter out these lines from your window, you'd have to use a pattern that matches lines consisting of one space character. You can do this easily with the -g (regex) switch:
Code:
filter -cwwxg %t.w_s %t.w_s ^ $


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#62267 30/11/03 08:34 PM
Joined: Dec 2002
Posts: 56
Babel fish
OP Offline
Babel fish
Joined: Dec 2002
Posts: 56
Thanks for the help!
I haven´t had any problems with the filtering of $crlf line out of txt files smile

Thanks again

#62268 30/11/03 10:49 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Quote:
I haven´t had any problems with the filtering of $crlf line out of txt files


I always had, at least for the last 5 versions or so:
Code:
//write -c crlf.txt $+(a,$crlf,$crlf,b,$crlf,$crlf,c) | filter -ffcx crlf.txt crlf.txt $crlf | run crlf.txt
I always get blank lines among a, b and c.


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

Link Copied to Clipboard