Hi,
What is the encoding used to generate the history .H00 files that PAC displays uses?
I am trying to load those files in Matlab for post processing unsuccessfully
Thank you,
Pablo
Hi,
What is the encoding used to generate the history .H00 files that PAC displays uses?
I am trying to load those files in Matlab for post processing unsuccessfully
Thank you,
Pablo
The encoding is ANSI text - you should be able to open them in notepad. The format is comma separated values.
Pablo, Did you ever figure out how to do this in Matlab? We’re trying to read one of these history files into R, and it’s coming up with gibberish for every type of encoding we’ve tried. “ANSI” is not one of the options. I think we’re having the same problem as you did. When I open the raw file in “Word” or “Wordpad”, it comes up with garbage characters in between EVERY single character, unless you specify the correct encoding in Word.
I think I could fix the problem by opening each file in Notepad and then resaving it, but that’s clunky, and I’d like to be able to process multiple files at the same time.
Thanks!
Yes. To load it in Maltab efficiently I do the following:
[FileName,PathName] = uigetfile(name,‘MultiSelect’,‘on’); % Several files selection for whole history loading
%Date,Time,…
%% Extract the data for the first file
if ischar(FileName)
fId = fopen([PathName,FileName]);
else
fId = fopen([PathName,FileName{1}]);
end
a = fgetl( fId );
nCols = sum( a == ‘,’ ) + 6 ; % 6 is for date and time splitting
buffer = fread( fId, Inf, ‘*char’ );
data = reshape( sscanf( buffer(2:2:end), ‘%f%*c’ ), nCols, [] ).’ ; % Here you jump the useless characters
fclose( fId );
Hope this help.