[Top][All Lists]

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

loading a filename beginning with a digit

From: John W. Eaton
Subject: loading a filename beginning with a digit
Date: Sun, 20 Jul 2003 21:20:37 -0500

On 20-Jul-2003, Mike Miller <address@hidden> wrote:

| Suppose, for example, that I have a file named 2x.txt with these contents:
| 1 3
| 9 5
| (Just two lines with two integers per line, but in real life I'll want to
| do this with larger files!)  When I load the file, I am not able to access
| the data.  (Please don't tell me to rename the file!  I just want to make
| the load function work within a script I'm writing no matter what the
| filename, if that's possible.)  I did this in a couple of versions of
| Octave on Solaris 8:
| octave:1> load 2x.txt
| octave:2> whos
| *** local user variables:
| prot  type               rows   cols  name
| ====  ====               ====   ====  ====
|  wd   matrix                2      2  2x

Hmm.  Octave 2.1.50 creates a variables called X2x instead so that it
will have a valid variable name.

Also, with reasonably recent versions you can use

  some_other_name = load ("2x.txt");


Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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