mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
if i want to add entries to a text file they get added as

entry1
entry2
entry3

etc.

so say i want to read this file and get info from matching line

but say item1 has info in entry2

and then an update occurred and the new info for item1 is in entry3

but as it has found the info in entry2 it will show that

so can I write or read the file in reverse order?

thanks

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
sure you can read in reverse order with $read

alias revorder {
var %x = $lines(mytext.txt)
while (%x >= 1) { echo -a $read(mytext.txt,%x) | dec %x }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can write to any line... to write in "reverse" order, use:

/write -il1 file.txt data


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
thanks guys - i'll try thr write first


Link Copied to Clipboard