[Top][All Lists]

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

Re: pasting data

From: Ozzy Lash
Subject: Re: pasting data
Date: Tue, 20 Mar 2018 21:02:25 -0500

On Tue, Mar 20, 2018 at 1:00 PM, Przemek Klosowski <address@hidden> wrote:
I often use octave for quick calculations.  For instance, I had some voltage/current data for a sensor, and wanted to see a plot and fit  a trendline (first and second order polynomials). I started by putting the data in a spreadsheet, but then I wanted to calculate some derived quantities and realized that  easier to work with the data in Octave.

The simplest and quickest way to cut data into Octave's commandline is to just assign it into an array: type 'a=[', then paste the table of data, and follow by a ']'. This works for most contexts, except when the column separator is a tab, as is the case when you're copying from a  spreadsheet. I think tabs trigger readline's completion mechanism and at best do nothing and at worst could corrupt pasted data.

The tabs are even a problem when constructing a string while trying to use strread().

I know that I could save the data into a file outside of octave ("cat > /tmp/data", paste data and type Ctrl-D) and textread() it, but that's too much work :)

Is there a way to temporarily disable readline's TAB functionality, or bypass it in some clever way?

There is probably a better way, but i didn't find a way to directly control the readline bindings, but you could create a file, say "readline_disable_tab" with the contents:

set disable-completion on

and then, in octave do a:



reply via email to

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