Extract Data from .txt File
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Alfredo Serna
el 27 de Oct. de 2021
Comentada: Alfredo Serna
el 28 de Oct. de 2021
Hi, someone can help me extract data from this .txt File? I'm interested in extracting the numeric values of "PeakEvm" that appears in the file.
I have tried to use textscan, pattern, extract and extractBetween but they are useless for this task.
0 comentarios
Respuesta aceptada
C B
el 27 de Oct. de 2021
Editada: C B
el 27 de Oct. de 2021
alltext = fileread('Datos_SSB_624_MHz_7_dB.txt');
% extract data between {"peakEvm": and },
allmatches = regexp(alltext,'(?<={"peakEvm":).*?(?=},)','match')
% extract data between {"percent": and ,
num1 = regexp(allmatches,'(?<={"percent":).*?(?=,)','match');
% extract data between "subcarrierNumber": and ,
num2 = regexp(allmatches,'(?<="subcarrierNumber":).*?(?=,)','match');
% extract data between "symbolNumber": and end
num3 = regexp(allmatches,'(?<="symbolNumber":).*?(?=)','match');
vertcat(num1{:})
vertcat(num2{:})
vertcat(num3{:})
Más respuestas (0)
Ver también
Categorías
Más información sobre Data Import and Export en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!