Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Thu Mar 13, 2003 12:47 am   

#read #write #erase delete?
 
I know i can set a file:
#file 1 test.txt
And then use #read and #write to append
And #erase will delete the file but
is there a way to delete an item example:
the file contains the word "Zugg"
i would like to remove all occurences of the word in the file.

Any suggestions?

megamog75
Keeper of the only printable help files for Zmud.
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Thu Mar 13, 2003 1:23 am   
 
While I did say I new of no direct way I think my question is can anyone think of a possibility?

And with Zmud there is always a way!!

megamog75
Keeper of the only printable help files for Zmud.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Mar 13, 2003 2:02 am   
 
I'd make it read, strip and push to another file.

#FILE 1 Foo.txt
#FILE 2 Foo2.txt
#LOOP %filesize(1) {#VARIABLE Temp %read(1,%i);#VARIABLE Temp %replace(@Temp,"Zugg","Darker");#WRITE 2 {@Temp}}
#CLOSE 1
#CLOSE 2

Ton Diening
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Thu Mar 13, 2003 2:51 am   
 
This worked great !!!
one question about above script.

When i do this I am actually just removing Zugg replaceing it with "" instead of darker.
but this gives me a blank line and I don't want the blank line either.

I tried revising this script with %remove("zugg",@temp)
but this left a blank line too.

Any ideas on that?


megamog75
Keeper of the only printable help files for Zmud.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Mar 13, 2003 3:59 am   
 
#IF (@Temp) {#WRITE 2 {@Temp}}

Just check to see that something is left in the line before you right it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net