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

[REBOL] Re: Quote character replacement

From: rebol:techscribe at: 26-Feb-2001 14:04

Hi Gabriele, you wrote:
> Then I can imagine what Elan's going to propose: replace all > newlines with a space.
Close, but not quite ;-). There may be newlines that need to be preserved, and we are only interested in those newlines that cause our problem, which are newlines embedded in double-quoted strings. strip-quoted-nl: func [string [string!] /local nl-rule] [ nl-rule: [thru {"} to "^/" mark: (change mark " ") thru {"}] parse string [some [nl-rule | skip] ] string ] print-strings-rule: [ set s string! (print mold s) | skip ] parse load strip-quoted-nl read %test-strings.txt [some print-strings-rule] YAA (Yet Another Approach) Elan