Extract Data from .txt File
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
C B
2021 年 10 月 27 日
編集済み: C B
2021 年 10 月 27 日
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{:})
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Import and Export についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!