MATLAB: Remove the header from multiple text files

remove the header from multiple text fileswithout headerwrite text file without header

Hi all..
I use the following code to export multiple columns in excel file to multiple text files (each column export as text file).
Walter Roberson wrote me the following code:
data = readtable('YourFileName.xls');
varnames = data.Properties.VariableNames;
for col = 1 : size(data, 2)
thisvar = varnames{col};
filename = sprintf('split_%s.txt', thisvar);
writetable( data(:,col), filename );
end
It works very well, but the only problem is each text file gets a header X1. Can I use this script without having header? The following screenshot explain more about the problem:

Best Answer

Consider using xlsread. It will separate the numeric values from the headers. You can still have access to the headers (and other non-numeric data) as well as the raw data by requesting 2 or 3 outputs from xlsread instead of only the first output.
Related Question