Home   Archive   Permalink



Read lines of text from clipboard

If you copy lines of text to the clipboard, like from a text editor, and then read them with REBOL, they come in as a string. I would like to get my hands on each individual line so I can do some processing on each line, and then write the lines back into the clipboard. I am wondering if that can be done. The best I can think of so far is to parse them on the linefeed, but that seems not to work. Thank you.
    
R E B O L []
    
;; In real life, input will be lines of text from the clipboard.
;; STR1: read clipboard://
STR1: {KJJ LKJKA KLKJJ ; xxx
LJLRE NNANN ; yyy
MAJRM LAJNLGJ NMLMRN ; zzz
}
    
BLK1: parse/all STR1 "^(newline)"
probe length? BLK1
    
halt

posted by:   Steven White     21-Nov-2017/15:51:32-8:00



BLK1: parse/all STR1 "^/"

posted by:   sqlab     22-Nov-2017/3:40:53-8:00