MATLAB: Input files editing format

abaqusinput text filesMATLAB

Hi, Good morning
I have an input file input.txt, i need to save the format in different two files node.txt and el.txt in the format attached files. Any help would be appreciated . Thank you inadvance.

Best Answer

fid = fopen('input.txt', 'r');
nodedata = cell2mat( textscan(fid, '%*f,%f,%f', 'CommentStyle', {'*Heading', '*Node'}) );
eldata = cell2mat( textscan(fid, '%*f,%f,%f,%f,%f', 'HeaderLines', 1) );
fclose(fid)