how to separate file name and put the number at the end to count files
Afficher commentaires plus anciens
I want to write a script for counting files. For example, my file name is "transport 052412_#1 3D gfp_z000_ch00.tif". I want to do 2 things. Firstly, I want to separate this name into base_name,transport 052412, and,varied_name,#1 3D gfp_z000_ch00. Then, I want to put the number at the of the file name to count such as 001, 002, and so on.
From this objective, I used fileparts [pathstr,name,ext,versn] = fileparts('filename') to separate the name of the file but it didn't work. So could you give me some advice for this.
Thanks, Nopparat
3 commentaires
Walter Roberson
le 28 Août 2012
Is the rule to separate it at the "#" ?
Nopparat
le 29 Août 2012
Walter Roberson
le 29 Août 2012
Then is the rule that the underscore is the separator?
In order to separate the name, we need rules about where the name part stops.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!