How to read .enf file

9 visualizaciones (últimos 30 días)
Denni Goodchild
Denni Goodchild el 28 de Oct. de 2020
Editada: per isakson el 28 de Oct. de 2020
I have an .enf file which I would like to load into matlab and search for a variable. I have converted the enf file to a .txt in order to upload here, assistance reading this file would be greatly appreciated. More specifically, I would like to know what FP1, FP2, FP3 and FP4 equal, the rest of the file is of no importance.
Currently, I have used uiopen which opens the .enf file into a tab in matlab but I am unsure as to how I use it from here.

Respuestas (1)

per isakson
per isakson el 28 de Oct. de 2020
Editada: per isakson el 28 de Oct. de 2020
A little exercise with regular expression
>> cssm( 'BFND_W6.txt' )
ans =
struct with fields:
FP1: 'Invalid'
FP2: 'Invalid'
FP3: 'Right'
FP4: 'Left'
where
function sas = cssm( ffs )
%%
xpr = ['^FP1\x20*=\x20*(?<FP1>\S+).*' ...
,'^FP2\x20*=\x20*(?<FP2>\S+).*' ...
,'^FP3\x20*=\x20*(?<FP3>\S+).*' ...
,'^FP4\x20*=\x20*(?<FP4>\S+)' ];
sas = regexp( chr, xpr, 'names', 'lineanchors');
end
Comments:
  1. the "rows" of xpr must appear in the same order as the rows in the data file, i.e. FP1,FP2,FP3,FP4
  2. \x20 is a way to indicate space without using space (it's hex).
  3. Space around = isn't needed for this sample file, but just in case.
  4. The first FPn in a "row" is the name in the text file, the next FPn is the name of the resulting structure field.

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by