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: 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: 117
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 = {};
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 at NCTM 1994-2018. All Rights Reserved.