mIRC Home    About    Download    Register    News    Help

Print Thread
#91197 20/07/04 07:25 PM
Joined: Oct 2003
Posts: 37
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2003
Posts: 37
I have a text file which separates data on a line using a $crlf, how can read past that $crlf to get the data at the end of the line?

$read stops at the $crlf and refuses to let me get access to anything else.

-eMpTy

#91198 20/07/04 07:28 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I don't think you can, even file handling acts the same:

$fread(name | N)

Returns the next $crlf delimited line.

Try seperating it by something different, eg: a TAB ($chr(9))


New username: hixxy
#91199 20/07/04 07:52 PM
Joined: Oct 2003
Posts: 37
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2003
Posts: 37
I didn't make it, otherwise I would have changed it...I'm thinking it's not possible too, anyone else have any ideas???

-eMpTy

#91200 20/07/04 07:59 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
You can TRY:

//bread FILEHERE.txt 0 1000 &t | //echo -> $bvar(&t,1,1000).text


and use $replace() to change $crlf to something more, um, manageable.

Eamonn.

#91201 20/07/04 09:00 PM
Joined: Oct 2003
Posts: 37
B
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Oct 2003
Posts: 37
hmmm...thanks I'll give that a shot...

-eMpTy

#91202 20/07/04 09:25 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
An example to see if this is what you want can be shown as:

type this as a command:

//var %i = 5000 | while (%i) { write moo.txt %i | dec %i }


Add this to your remotes

alias breading {
if (!$1) { var %d = 900 }
var %fs = 0
while ($file(moo.txt) >= %fs) {
bread moo.txt %fs %d &t
echo -> $replace($remove($bvar(&t,1,%d).text,$chr(10)),$chr(13),~)
inc %fs %d
}
}

Syntax: /breading

Will output numbers, 5000 - 1, seperated by ~ instead of your $crlf.

Eamonn

#91203 21/07/04 12:40 AM
Joined: Dec 2002
Posts: 230
G
Fjord artisan
Offline
Fjord artisan
G
Joined: Dec 2002
Posts: 230
if you separate it using a $crlf, why dont you just read the next line then?

#91204 21/07/04 09:27 AM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
To be perfectly honest greeny, i asked myself that but he asked to "read past" the crlf, for some reason or another, and that was the solution, although perhaps hes' only using a $cr not $crlf, so it would appear all on one line but $read wouldnt catch it.

Eamonn.


Link Copied to Clipboard