[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: trying to do a dos copy file command from an octave function in Wind
From: |
Tim Rueth |
Subject: |
RE: trying to do a dos copy file command from an octave function in Windows Vista |
Date: |
Wed, 28 Jul 2010 22:00:30 -0700 |
> -----Original Message-----
> From: Tatsuro MATSUOKA [mailto:address@hidden
> Sent: Wednesday, July 28, 2010 9:48 PM
> To: address@hidden; 'Octave-ML'
> Subject: Re: trying to do a dos copy file command from an
> octave function in Windows Vista
>
> Hello
>
> > dos("copy fin fout");
>
> should be
>
> dos(["copy " fin fout]);
>
> Regards
>
> Tatsuro
>
> --- Tim Rueth wrote:
>
> > Hi all,
> >
> > I'm trying to effectively do the following Windows DOS command from
> > within an Octave function:
> >
> > copy var1*var2.txt var1var2.txt
> >
> > So, I created the following very simple function:
> >
> > function [] = concatresults(var1, var2); # copy all var1...var2.txt
> > files to a single output file called var1var2.txt
> >
> > fin = [var1 "*" var2 ".txt"];
> > fout = [var1 var2 ".txt"];
> > dos("copy fin fout");
> >
> > endfunction;
> >
> > The function doesn't work, and when I execute the
> individual commands
> > at the octave prompt, it says "The system cannot find the file
> > specified." after executing the dos() function.
> >
> > I could just open up a command window and do the copy, but
> I'm hoping
> > to automate this as part of a larger function. I'm sure there's a
> > simple way to do this from within Octave. Help please?
> >
> > Thanks,
> >
> > --Tim
Brilliant. Works perfectly (after I added a " " between the two file names
in the copy command). Thanks!