How to ignore or delete the last row of a text file when importing?
Show older comments
I am reading in data using textscan. Often times the last row of data is bad and throws an error. How can I ignore the last line? or is there code to delete the last row of data in the text file programmatically?
Accepted Answer
More Answers (1)
Image Analyst
on 31 May 2015
0 votes
Put it in a try catch block. Look it up in the help. You can just have your catch block be empty if you want to ignore any errors.
Categories
Find more on Data Import and Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!