|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: 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. |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: 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. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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 |
|
|
|
megamog75 Enchanter
Joined: 20 Nov 2002 Posts: 627 Location: USA
|
Posted: 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. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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. |
|
|
|
|
|