[EMAIL PROTECTED] wrote:
> 
> howdy guys,
> 
> so far, I know how to add to an existing file with write/append.
  ...
> 
> to put either a string or another file in there, would it be somthing
> like,
> 
>  read %fox find quick insert %otherfile
> 
> ?
> 
> not even close, I'm sure... :-)
> 

Actually, it's very close (my tape measure is slightly stretchy! ;-)

You could do it in memory:

    >> read %file1.text
    == "This is a test.^/"
    >> read %file2.text
    == "(small but enlightening) ^/"
    >> head insert find read %file1.text "test" read %file2.text
    == "This is a (small but enlightening) ^/test.^/"

or write the result back to disk:

    >> write %file1a.text head insert find read %file1.text "test" read
%file2.text
    >> read %file1a.text
    == "This is a (small but enlightening) ^/test.^/"

Obviously you could write it back over one of the input files; the
hazards of doing so are well-known (and have nothing to do with
REBOL).

-jn-

Reply via email to