help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it possible to drag-n-drop data into Octave workspace?


From: Przemek Klosowski
Subject: Re: Is it possible to drag-n-drop data into Octave workspace?
Date: Tue, 21 Feb 2017 13:16:07 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 02/21/2017 12:27 PM, Nicholas Jankowski wrote:
ans =

   1
   2
   3
   4
   5
   6
Interesting. I would have thought without the semicolons it would
treat the linebreak as whitespace and make that a row vector. Don't
have it open in front of me, but is that normal behavior for an input
split over multiple lines without using line continuation marks? If
so, what happens if you try to do the same pasting in a 2-column set
of data?
It works as-is---whitespace  within rows divides columns, and newlines create new rows.

>From the original question, could the 'paste' function in the gui
somehow catch, recognize and automatically make the array input
happen?
This is an annoying glitch: it almost works but ultimately fails with a bizarre behavior, because cutting and pasting from a typical spreadsheet uses tabs between the successive numbers in each row, and tab is processed by the readline code. As a result, most of the time tabs are simply eaten up and all the  numbers on each line are collated, except when the tab triggers a match, inserting random readline history items. 

Of course readline is very useful, even while reading data arrays, so it's not a good solution to turn it off entirely---but maybe there would be a way to suspend it for a single command? I don't think there is a way to do it automatically for cut-and-paste because commandline octave has no way of knowing what's coming its way. Maybe the GUI could tell and adapt.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]