filenameHTML = 'Example.html';
txt = fileread('Example.html');
txt = regexprep(txt,'<script.*?/script>','');
txt = regexprep(txt,'<style.*?/style>','');
txt = regexprep(txt,'<.*?>','');
txt = regexprep(txt,'.*#\n','');
txt = regexprep(txt,'--.*?\n','');
txt = regexprep(txt,'\n\n.*','');
delimiter = {' = '};
formatSpec = '%q%q%[^\n\r]';
dataArray = textscan(txt, formatSpec, 'Delimiter', delimiter, ...
'TextType', 'char', 'ReturnOnError', false);
raw = repmat({''},length(dataArray{1}),length(dataArray)-1);
for col = 1:(length(dataArray)-1)
raw(1:length(dataArray{col}),col) = dataArray{col};
end;
filenameSpreadsheet = 'Example.xlsx';
xlswrite(filenameSpreadsheet,raw)
Best Answer