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.