[Jprogramming] Reading multiline data from clipboard
Devon McCormick
devonmcc at gmail.com
Thu Jan 31 00:56:41 UTC 2019
This is kind of a Quine:
load'~addons/general/misc/clippaste.ijs'
xx=:getcliptext''
since it produces itself as the output if I cut and paste it into a J
session.
On Tue, Jan 29, 2019 at 11:15 AM David Mitchell <
davidmitchell at honeoyeincolor.biz> wrote:
> On windows, this will read multiline data from the clipboard in jconsole
> or jqt:
>
> load'~addons/general/misc/clippaste.ijs'
> xx=:getcliptext''
>
> xx
> "cell_type": "code",
> "execution_count": 10,
> "metadata": {},
> "outputs": [
> {
> "name": "stdout",
> "output_type": "stream",
> "text": [
> "The Truth Is Out There\n"
>
> Cheers,
> David Mitchell
>
> On 1/29/2019 11:02, Brian Schott wrote:
> > I find reading multiline data into jconsole (or even into jqt) to be
> > awkward unless the data are in a file. I would like to be able to read
> data
> > from the clipboard directly into some pre-named noun.
> >
> > The list of steps I use is annoyingly long.
> > a) prepend the data with 'data =. (0 : 0)' ,
> > b) press <return>,
> > c) copy the data into the clipboard,
> > d) paste into the jconsole,
> > e) press <return>,
> > f) end with ')', and
> > g) press <return>
> >
> > The original version of J for ipad (and likely, the updated version as
> > well) offers the following verb which works quite well. I'm wondering if
> > there is a similar verb for jconsole (or jqt) (that I may have missed).
> >
> > jfromcb =: 3 : 0
> > smoutput '<ioscmd>fromcb '
> > fread'data'
> > )
> >
> > Thanks,
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
Devon McCormick, CFA
Quantitative Consultant
More information about the Programming
mailing list