extracting specific data from extra large text file( a part of it is attached) into an array in the format mentioned in the attached excel
3 次查看(过去 30 天)
显示 更早的评论
Hi,
Seeking for help in extracting data from a very big text file( a part of it is attached) into an array of format mentioned in the attached excel. Basically, trying to extract data between two strings ---Tx RF verify Measurement Results--- and ---Performing Tx RF verify ended--- into an array as per the format attached in the excel.
5 个评论
per isakson
2019-1-3
编辑:per isakson
2019-1-4
This might be a first step
%%
fid = fopen('example.txt');
% 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
cac = textscan( fid, '%*s%*s%s%d%s%d%s%s%f%s%f%s%s%d%s%s%s%s%s%f%[^\r\n]' ...
, 'Headerlines',2, 'Delimiter','\t', 'MultipleDelimsAsOne',false );
fclose( fid );
It reads three lines too many, thus end-3 . Inspect the result
>> cac{18}(1:end-3)
ans =
22.9500
3.4100
22.0500
23.9500
4.4100
25.0500
>> cac{7}(1:end-3)
ans =
180
180
180
181
181
181
cac{19}(1:end-3)
ans =
6×1 cell array
{'Limits 22 to 24 [dBm] Passed'}
{'Limit 6 [%] Passed' }
{'Limit 30 [%] Passed' }
{'Limits 22 to 24 [dBm] Passed'}
{'Limit 6 [%] Passed' }
{'Limit 30 [%] Passed' }
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!