The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Filenames
Replies: 1   Last Post: Aug 5, 2014 3:11 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2,359
Registered: 12/6/04
Re: Filenames
Posted: Aug 5, 2014 3:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Will " <> wrote in message <lrr5rr$cl4$>...
> I am trying to use matlab to analyze some data and export it to excel. My data is in files with identical names except the ending is a number. for example
> text_#1.txt
> There are sometimes thousands of these files. My problem is that matlab processes them in this order
> 100
> 10
> 1
> 12
> 13
> etc
> There are far too many files to change manually so I would like to change the files to all the same number of digits using matlab. for example:
> text_#1.txt would change to text_#001.txt
> anyone know how to do it?
> Thanks

Look here:


and modify the example using the '0' flag in sprintf shown here:


to zero pad the field width.

Date Subject Author
Read Filenames
Read Re: Filenames

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.