I want to delete the ROW data from excel by reading Column in the same sheet
1 view (last 30 days)
Santosh Biradar on 27 Jul 2022
%%raw is having data of excel size 10X20
%%SummaryResult.xlsx is excel havinnd "aaa" is sheet name
If aaa sheet contains initial with "Z" WORD then I will delete that ROW.
Index = find(contains(raw(1:numrow1,1:1),'Z'));
xlswrite('SummaryResult.xlsx',raw(~Index,:),'aaa','A2') ％％here I am trying to delete to delete those rows which is having Z letter
Walter Roberson on 27 Jul 2022
xlsread() does not create a table; none of the columns will have column names. You should use readtable
tab = readtable('SummaryResult.xlsx', 'sheetname', 'aaa', 'VariableRenaming', 'Preserve');
tab(startsWith(tab.('Analysis Target or not'),["Z"]),:) = ;
writetable('SummaryResult.xlsx', tab, 'sheetname', 'aaa')
numrow3 = size(tab,1);
More Answers (1)
Githin George on 27 Jul 2022
My understanding is that you will be importing the table, editing it and then writing it back to the excel sheet.
You can try out the following idea for removing the rows you want to
% tab is the imported column
% This line just deletes the rows for which YourColName of the table
% contains "Z"
tab(contains(tab.YourColName,["Z"]),:) = 
You can write the modified table to your excel sheet.
Hope it helps