updating and saving .dat files

I have a .dat file created by a different software package which I would like to amend slightly in matlab and resave. I have done this using the fopen and fprintf commands. However, when I use the new .dat file, the software package doesn't recognise it (even though when I open it up in notepad it looks fine). If I open the .dat file in notepad and manually make changes and save it (using ANSI encoding), it's fine.
I have tried using the windows-1252 encoding (which I believe is the code page for ANSI on my system) with the fopen (and subsequent fprintf) commands but this doesn't seem to work.
Any help would be appreciated.

回答 (1 件)

per isakson
per isakson 2012 年 8 月 9 日
編集済み: per isakson 2012 年 8 月 9 日

0 投票

I guess "different software" requires "'\r\n'" for newline in the format specifier.

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2012 年 8 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by