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: copy and rename ascii files
Replies: 2   Last Post: Jul 29, 2011 3:46 PM

Advanced Search

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

Posts: 114
Registered: 2/1/08
copy and rename ascii files
Posted: Jul 29, 2011 3:37 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm trying to copy text (ascii) files and rename them. The filenames
are called


and I want to obtain the same files with the changed name like


I've tried the following so far, but with limited success. Can anyone help?
The code that I have generates a file with the desired name, but the file is empty.

Best Regards,

filesStruct = dir('*.la');
files = {filesStruct.name};
temp = textread(files{1}, '%s', 'whitespace', '');
temp_name1 = files{1};
temp_name2 = [temp_name1(1:end-11) 'interpolatet.tu'];
fid = fopen(temp_name2, 'wt');
fprintf(fid, '%s', temp);

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

[Privacy Policy] [Terms of Use]

© The Math Forum 1994-2015. All Rights Reserved.