Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

Topic: Renaming files based on spreadsheet
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Eric Jackson

Posts: 4
Registered: 7/5/14
Renaming files based on spreadsheet
Posted: Jul 5, 2014 8:05 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

I'm trying to rename a batch of files within MATLAB using codes from an external spreadsheet (on mac). Here is a sample of the spreadsheet including codes:

Base
L1
C3
C2
C3
Base
C2
L1

And this is a sample list of files:

PWSM10A_2014_05_23_112132_001_Odau_1.wav
PWSM10A_2014_05_23_112132_002_Odau_1.wav
PWSM10A_2014_05_23_112132_003_Odau_1.wav
PWSM10A_2014_05_23_112132_004_Odau_1.wav
PWSM10A_2014_05_23_112132_005_Odau_1.wav
PWSM10A_2014_05_23_112132_006_Odau_1.wav
PWSM10A_2014_05_23_112132_007_Odau_1.wav
PWSM10A_2014_05_23_112132_008_Odau_1.wav

Both lists will always be in the correct (corresponding) order. I want the codes to appear at the beginning of the file names, followed by "_" (e.g., "Base_PWSM10A_2014_05_23_112132_001_Odau_1.wav", "L1_PWSM10A_2014_05_23_112132_002_Odau_1.wav", and so on).

I have attempted to use csvread, textread, and textscan, together with movefile, but have not been successful. One major obstacle has been that MATLAB appears to not (easily) read strings of varying length. It may go without saying, but I am MATLAB novice. I would appreciate any help anybody is willing to offer.

Thank you!

Eric




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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.