help-octave
[Top][All Lists]
Advanced

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

User input file selection


From: Stuart Edwards
Subject: User input file selection
Date: Wed, 26 Aug 2009 09:32:40 -0400

Hi -

This is probably a trivial question, but has me stumped. I'm writing a script that requires the user to input the name of a data file, and then load and process the contents.

I tried:

> datafile=input("enter the name of the datafile ", "s")
> load datafile

after inputing the file name, this returns an error 'could not find the file datafile'

and

> datafile=input("enter the name of the datafile ", "s")
> load(datafile)

seems to load the name of the datafile as a string and subsequent processing merely shuffles the characters in the file name around. I've tried various other syntax 'guesses' but no success.

Any suggestions?

Thanks for your time.

Stu




reply via email to

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