[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:
From: |
Sergei Steshenko |
Subject: |
Re: |
Date: |
Wed, 24 Jul 2013 02:06:22 -0700 (PDT) |
>________________________________
> From: Jeff <address@hidden>
>To:
>Cc: Octave users list <address@hidden>
>Sent: Wednesday, July 24, 2013 5:42 AM
>Subject: Re:
>
>
>
>... well, with the one catch that I still have to modify my program each run
>instead of just listing the files and piping them into my program. But still,
>much easier than the way I was doing it.
>
>
>
>On Tue, Jul 23, 2013 at 10:32 PM, Jeff <address@hidden> wrote:
>
>Yes, I can just use glob(), but only if I had known about it! :D (IOW:
>Thanks).J
>>
>>
>>
>>On Tue, Jul 23, 2013 at 10:19 PM, Dmitri A. Sergatskov <address@hidden> wrote:
>>
>>On Tue, Jul 23, 2013 at 8:59 PM, Jeff <address@hidden> wrote:
>>>
>>>
>>>>
>>>>I'm running in Linux. Linux usually lets you list files and pass them into
>>>>programs, or pass the output of one program into another, etc. Is there a
>>>>way to do that for Octave files, too?
>>>>
>>>>
>>>>In other words, I want to program it so I can do something like this
>>>>ls <select-specific-files> | makeGraph.m
>>>>where makeGraph.m would then execute in Octave and process each file? Can I
>>>>do that in Octave? How?
>>>>
>>>>
>>>>
>>>>
>>>
>>>Perhaps I misunderstood what you really want, but could you just use glob()?
>>>
>>>Like :
>>>
>>>fl = glob("*Beta=0195*.csv");
>>>nfiles = rows(fl);
>>>
>>>
>>>for ii = 1:nfiles
>>>
>>> u1 = csvread(fl{ii});
>>>
>>> ...etc...
>>>
>>>endfor
>>>
>>>Dmitri.
>>>--
>>>
>>>
>>>
>>>
>>>
>>>
>>
>
>_______________________________________________
>Help-octave mailing list
>address@hidden
>https://mailman.cae.wisc.edu/listinfo/help-octave
>
>
>
First of all, there is a cross-platform way to list files in directory - try
help readdir
.
Likewise, there is a cross-platform way to choose only the needed files - try
help regexp
.
Finally, even if you need to modify the program, you need to modify only a
small portion, and it is implemented conceptually by replacing the part to be
modified with
source("path/to/the/portion/to/be/modified");
.
Regards,
Sergei.
- [no subject], Jeff, 2013/07/23
- Re:, Dmitri A. Sergatskov, 2013/07/23
- Re:, Jeff, 2013/07/23
- Re:, Jeff, 2013/07/23
- Re:,
Sergei Steshenko <=
- Re:, Richard Kirk, 2013/07/24