Why fscanf return strange character I do not see in notepad?
    3 views (last 30 days)
  
       Show older comments
    
Hi all,
I have several txt files that look fine in Notepad, but they are full of strange characters from fscanf and I'm wondering why it occurs.
Here my code:
TxtFid=fopen([TxtPath TxtFile]);
    Txt=fscanf(TxtFid,'%c');
Here how the a part of the file looks like in notepad:
      ≤ 25,33                                              de /  from   0 à / to 28,6
Here how the same part looks from fscanf:
         ≤ 25,33                                              de /  from   0 à / to 28,6
Why does it occur? For the coding? May trying several codings solve the problem?
I tried yo change the coding as the following:
    TxtFid=fopen([TxtPath TxtFile],[],[],'windows-847');
but Matlab returns:
Error using fopen
Invalid permission.
How may I solve the problem?
Thanks
Cheers
3 Comments
  Walter Roberson
      
      
 on 9 May 2016
				You need to provide valid entries there. Empty entries are not accepted.
Accepted Answer
More Answers (0)
See Also
Categories
				Find more on Low-Level File I/O in Help Center and File Exchange
			
	Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!