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: txt files, read and write
Replies: 7   Last Post: Oct 1, 2013 8:51 AM

Advanced Search

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

Posts: 8,182
Registered: 6/7/07
Re: txt files, read and write
Posted: Sep 30, 2013 4:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 9/30/2013 2:56 PM, Andreas wrote:
> Hello, i have the following problem.
>
> I have a cfd. file that i can read and edit it via text editor such as
> notepad. What i want, is from that file to change specific numbers in
> it. I already used a variety of the printf, textscan and such commands
> but the problem is that for some reason it changes the structure of the
> file.
> The .cfd file is the following:
>
> http://speedy.sh/u4JSp/Demo-CFD0-hallway.cfd
>
> I want to change a number without ruin the structure of the file because
> then i use that file in a program. If i change the structure, the
> program will be unable to read it. What i mean by changing the
> structure, you will see by yourselves if you run the standard textscan
> and fprintf commands.


That site wanted to use some addon I don't want so can't see the file,
sorry. Paste a short piece that is causing problems and the code you
used to try to modify it.

A sequential file will, of course, have to be rewritten in its entirety
unless it can be treated as fixed record length and you know where,
precisely the bytes are located that you wish changed and they're the
same number of bytes as well.

It undoubtedly will be/is possible to write a formatting string that
will produce a readable file; one needs, however, to know what that
format is to do it, specifically.

--





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.