Extract Data from .txt File
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
C B
le 27 Oct 2021
Modifié(e) : C B
le 27 Oct 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{:})
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import and Export dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!