Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Same block, different formats

From: joel:neely:fedex at: 13-Oct-2001 22:11

Hi, Donald, Donald Dalley wrote:
> I have REBOL read a directory, to get a block of file names. I want > to make two different uses of that file list. >
...
> When the block is written to a file and that file is read with a > text reader or editor, though, the names are one long, continuous > string. This format is obviously useless to me. > > "AAAAACAAPLABCABFABGXABIABKABSABTABXACKACV..." > > Why, and what can I do to ensure that the written block is space > separated? The only difference is in how the block is presented. > In both cases, the block is the same block. >
This works for me.
>> foo: read %./
== [%ArchVision.doc %Combined Vision.doc %Future Vision.doc %Combined Vision1a.doc %allstate1.xls %expen...
>> write/lines/with %tempkill.foo foo "^/"
The effect is to place each file name on a separate line, which takes care of ambiguities if the file names contain embedded spaces. -jn- -- ; sub REBOL {}; sub head ($) {@_[0]} REBOL [] # despam: func [e] [replace replace/all e ":" "." "#" "@"] ; sub despam {my ($e) = @_; $e =~ tr/:#/.@/; return "\n$e"} print head reverse despam "moc:xedef#yleen:leoj" ;