The standard advice for reading the clipboard on OSX is to use the
pipe(pbpaste) connection, but I'm finding it misses the last line. (I
believe the last line in my examples generally doesn't include any EOL
marker.) For example, if I highlight these three lines:
line 1
line 2
line 3
and copy
On 03 Sep 2014, at 13:56 , Duncan Murdoch murdoch.dun...@gmail.com wrote:
The standard advice for reading the clipboard on OSX is to use the
pipe(pbpaste) connection, but I'm finding it misses the last line. (I
believe the last line in my examples generally doesn't include any EOL
marker.)
On 03 Sep 2014, at 14:29, peter dalgaard pda...@gmail.com wrote:
This works, presumably because text connections are not non-blocking:
readLines(textConnection(system(pbpaste,intern=TRUE)))
[1] line 1 line 2 line 3”
or the following should also work on each OSX
readLines(pipe(pbpaste|awk
On Wed, Sep 3, 2014 at 3:29 PM, peter dalgaard pda...@gmail.com wrote:
On 03 Sep 2014, at 13:56 , Duncan Murdoch murdoch.dun...@gmail.com wrote:
[...]
This works, presumably because text connections are not non-blocking:
readLines(textConnection(system(pbpaste,intern=TRUE)))
[1] line 1 line 2