Deleting specific rows in an excel file

9 views (last 30 days)
Hello everyone,
I recently started working with MATLAB and have to write a script reading out an excel file and creating a new one with only some specific columns and rows of the previous excel file.
I am encountering a problem with deleting rows in a specific column. The idea is that each row in a column named "TriggerHint" with a value > 15 is being disregarded in the new excel file.
The only things I came up with so far ar either
rows_TriggerHint= pp.TriggerHint<16
or
index=ismember(data_pp.TriggerHint, > 15)
which both don't work.
Thank you in advance!
Luisa

Accepted Answer

Stephan
Stephan on 17 Nov 2020
Download the attached file - and copy it in your working directory:
T = readtable('TriggerHintExample.xlsx')
T(T.TriggerHint > 15,:) = []
writetable(T,'myNewFile.xlsx')
  1 Comment
Lui Sa
Lui Sa on 17 Nov 2020
Thank you very much for your help, Stephan. With your code the script worked now!
Best wishes,
Luisa

Sign in to comment.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!