Hi, I have the following code to read all the csv files in a directory.
close all;csvfiles = dir('*.csv');for file = csvfiles' datafromfile = csvread(file.name, 17, 0); freq = datafromfile(:,1); power = datafromfile(:,2);end
However, the csv files contain a cell with END in the last cell, as follows. This results in an error when the script runs.
HEADER HEADER HEADERHEADER HEADER HEADER 29950250 3.46649905459066 0 0 030000000 5.23598452822347 0 0 0END
How can I remove the last element/row from the csv so the script runs?
EDIT: I've included an example csv file.
Best Answer