How to read lines from cell
this time I’m trying to process data from a .txt file.
my goal is to extrat the information at specific lines.
I load my file
temp3 = regexp(fileread(‘DT_Diagra_ScanTool_DT62234_T0410_SHAP_001.txt’), ‘r?n’, ‘split’)’;
I got a 680×1 cell
I made and index to find the line in whic is the value I wnat.
idc = strfind(temp3,’PID 01′);
idx = ~cellfun(‘isempty’,idc);
is there any way to get all the ‘0’ and ‘1’ in that row?
after that I will also need to get the next 4 lines below and end up getting below values
0000 0000
0000 0111
1110 0101
1110 0101
as always any feedback will be high appreciatedthis time I’m trying to process data from a .txt file.
my goal is to extrat the information at specific lines.
I load my file
temp3 = regexp(fileread(‘DT_Diagra_ScanTool_DT62234_T0410_SHAP_001.txt’), ‘r?n’, ‘split’)’;
I got a 680×1 cell
I made and index to find the line in whic is the value I wnat.
idc = strfind(temp3,’PID 01′);
idx = ~cellfun(‘isempty’,idc);
is there any way to get all the ‘0’ and ‘1’ in that row?
after that I will also need to get the next 4 lines below and end up getting below values
0000 0000
0000 0111
1110 0101
1110 0101
as always any feedback will be high appreciated this time I’m trying to process data from a .txt file.
my goal is to extrat the information at specific lines.
I load my file
temp3 = regexp(fileread(‘DT_Diagra_ScanTool_DT62234_T0410_SHAP_001.txt’), ‘r?n’, ‘split’)’;
I got a 680×1 cell
I made and index to find the line in whic is the value I wnat.
idc = strfind(temp3,’PID 01′);
idx = ~cellfun(‘isempty’,idc);
is there any way to get all the ‘0’ and ‘1’ in that row?
after that I will also need to get the next 4 lines below and end up getting below values
0000 0000
0000 0111
1110 0101
1110 0101
as always any feedback will be high appreciated matlab, txt, cell MATLAB Answers — New Questions