Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
listing input file...

Subject: listing input file...

From: edward kabanyas

Date: 25 Oct, 2011 08:12:28

Message: 1 of 6

Dear all,

I wan to read many input files consecutively/sequentially . I use the following simple code to read the files:

dos(' dir /b *.z > list');

I got List file as:

S.060201.0.6.HDF.Z
S.060201.12.6.HDF.Z
S.060201.15.HDF.Z
S.060201.18.HDF.Z
S.060201.21.HDF.Z
S.060201.3.HDF.Z
S.060201.6.HDF.Z
S.060201.9.HDF.Z


This list file is not sequential, because the output must be:

S.060201.0.HDF.Z
S.060201.3.HDF.Z
S.060201.6.HDF.Z
S.060201.9.HDF.Z
S.060201.12.HDF.Z
S.060201.15.HDF.Z
S.060201.18.HDF.Z
S.060201.21.HDF.Z

Last column indicate time in a day from 0-21. Do you see any simple way to make them in sequence ? Thanks for help.

Edward

Subject: listing input file...

From: edward kabanyas

Date: 25 Oct, 2011 08:17:29

Message: 2 of 6

Dear all,

Sorry few corrections for the file name..

I wan to read many input files consecutively/sequentially . I use the following simple code to read the files:

dos(' dir /b *.z > list');

I got List file as:

S.060201.0.HDF.Z
S.060201.12.HDF.Z
S.060201.15.HDF.Z
S.060201.18.HDF.Z
S.060201.21.HDF.Z
S.060201.3.HDF.Z
S.060201.6.HDF.Z
S.060201.9.HDF.Z


This list file is not sequential, because the output must be:

S.060201.0.HDF.Z
S.060201.3.HDF.Z
S.060201.6.HDF.Z
S.060201.9.HDF.Z
S.060201.12.HDF.Z
S.060201.15.HDF.Z
S.060201.18.HDF.Z
S.060201.21.HDF.Z

Last column indicate time in a day from 0-21. Do you see any simple way to make them in sequence ? Thanks for help.

Edward

Subject: listing input file...

From: Nasser M. Abbasi

Date: 25 Oct, 2011 08:49:37

Message: 3 of 6

On 10/25/2011 3:17 AM, edward kabanyas wrote:
> Dear all,
>
> Sorry few corrections for the file name..
>
> I wan to read many input files consecutively/sequentially . I use the following simple code to read the files:
>
> dos(' dir /b *.z> list');
>
> I got List file as:
>
> S.060201.0.HDF.Z
> S.060201.12.HDF.Z
> S.060201.15.HDF.Z
> S.060201.18.HDF.Z
> S.060201.21.HDF.Z
> S.060201.3.HDF.Z
> S.060201.6.HDF.Z
> S.060201.9.HDF.Z
>
>
> This list file is not sequential, because the output must be:
>
> S.060201.0.HDF.Z
> S.060201.3.HDF.Z
> S.060201.6.HDF.Z
> S.060201.9.HDF.Z
> S.060201.12.HDF.Z
> S.060201.15.HDF.Z
> S.060201.18.HDF.Z
> S.060201.21.HDF.Z
>
> Last column indicate time in a day from 0-21. Do you see any simple way to make them in sequence ? Thanks for help.
>
> Edward

See first if you can get the list of files sorted out from DOS. If that does not work,
then look into sorting them next.

DOS has the /T option to generate the list of files sorted

/T Controls which time field displayed or used for sorting
timefield C Creation
             A Last Access
             W Last Written

--Nasser

Subject: listing input file...

From: edward kabanyas

Date: 25 Oct, 2011 09:11:28

Message: 4 of 6

Hi Nasser ;

thanks, but it does not work..

Edward


"Nasser M. Abbasi" <nma@12000.org> wrote in message <j85t71$m5i$1@speranza.aioe.org>...
> On 10/25/2011 3:17 AM, edward kabanyas wrote:
> > Dear all,
> >
> > Sorry few corrections for the file name..
> >
> > I wan to read many input files consecutively/sequentially . I use the following simple code to read the files:
> >
> > dos(' dir /b *.z> list');
> >
> > I got List file as:
> >
> > S.060201.0.HDF.Z
> > S.060201.12.HDF.Z
> > S.060201.15.HDF.Z
> > S.060201.18.HDF.Z
> > S.060201.21.HDF.Z
> > S.060201.3.HDF.Z
> > S.060201.6.HDF.Z
> > S.060201.9.HDF.Z
> >
> >
> > This list file is not sequential, because the output must be:
> >
> > S.060201.0.HDF.Z
> > S.060201.3.HDF.Z
> > S.060201.6.HDF.Z
> > S.060201.9.HDF.Z
> > S.060201.12.HDF.Z
> > S.060201.15.HDF.Z
> > S.060201.18.HDF.Z
> > S.060201.21.HDF.Z
> >
> > Last column indicate time in a day from 0-21. Do you see any simple way to make them in sequence ? Thanks for help.
> >
> > Edward
>
> See first if you can get the list of files sorted out from DOS. If that does not work,
> then look into sorting them next.
>
> DOS has the /T option to generate the list of files sorted
>
> /T Controls which time field displayed or used for sorting
> timefield C Creation
> A Last Access
> W Last Written
>
> --Nasser

Subject: listing input file...

From: Doug Schwarz

Date: 25 Oct, 2011 11:03:12

Message: 5 of 6

In article <j85rap$tk$1@newscl01ah.mathworks.com>,
 "edward kabanyas" <djuky_hmi@yahoo.com> wrote:

> Dear all,
>
> Sorry few corrections for the file name..
>
> I wan to read many input files consecutively/sequentially . I use the
> following simple code to read the files:
>
> dos(' dir /b *.z > list');
>
> I got List file as:
>
> S.060201.0.HDF.Z
> S.060201.12.HDF.Z
> S.060201.15.HDF.Z
> S.060201.18.HDF.Z
> S.060201.21.HDF.Z
> S.060201.3.HDF.Z
> S.060201.6.HDF.Z
> S.060201.9.HDF.Z
>
>
> This list file is not sequential, because the output must be:
>
> S.060201.0.HDF.Z
> S.060201.3.HDF.Z
> S.060201.6.HDF.Z
> S.060201.9.HDF.Z
> S.060201.12.HDF.Z
> S.060201.15.HDF.Z
> S.060201.18.HDF.Z
> S.060201.21.HDF.Z
>
> Last column indicate time in a day from 0-21. Do you see any simple way to
> make them in sequence ? Thanks for help.
>
> Edward

My sort_nat was written for exactly this purpose:

<http://www.mathworks.com/matlabcentral/fileexchange/10959-sortnat-natura
l-order-sort>

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

Subject: listing input file...

From: edward kabanyas

Date: 25 Oct, 2011 12:33:31

Message: 6 of 6

Hi Doug Schwarz !

Thanks so much, it works perfectly.

Cheers
Edward
 <see@sig.for.address.edu> wrote in message <see-E27774.07031225102011@news.frontiernet.net>...
> In article <j85rap$tk$1@newscl01ah.mathworks.com>,
> "edward kabanyas" <djuky_hmi@yahoo.com> wrote:
>
> > Dear all,
> >
> > Sorry few corrections for the file name..
> >
> > I wan to read many input files consecutively/sequentially . I use the
> > following simple code to read the files:
> >
> > dos(' dir /b *.z > list');
> >
> > I got List file as:
> >
> > S.060201.0.HDF.Z
> > S.060201.12.HDF.Z
> > S.060201.15.HDF.Z
> > S.060201.18.HDF.Z
> > S.060201.21.HDF.Z
> > S.060201.3.HDF.Z
> > S.060201.6.HDF.Z
> > S.060201.9.HDF.Z
> >
> >
> > This list file is not sequential, because the output must be:
> >
> > S.060201.0.HDF.Z
> > S.060201.3.HDF.Z
> > S.060201.6.HDF.Z
> > S.060201.9.HDF.Z
> > S.060201.12.HDF.Z
> > S.060201.15.HDF.Z
> > S.060201.18.HDF.Z
> > S.060201.21.HDF.Z
> >
> > Last column indicate time in a day from 0-21. Do you see any simple way to
> > make them in sequence ? Thanks for help.
> >
> > Edward
>
> My sort_nat was written for exactly this purpose:
>
> <http://www.mathworks.com/matlabcentral/fileexchange/10959-sortnat-natura
> l-order-sort>
>
> --
> Doug Schwarz
> dmschwarz&ieee,org
> Make obvious changes to get real email address.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us