Hi,
I am working on importing a .txt file, altering some of the text inside of it then, writing it to a new .txt file.
I import the .txt file as a cell array, perform my math then, attempt to write it back to a new .txt file.
The text I am attempting to alter is CNC code. Therefore, at the end of each line I need a semi-colon.
This is my code:
fid = fopen('newpartcode.txt','w');for i=1:m fprintf(fid,'%s',pcn{i,:}); fprintf(fid,';'); fprintf(fid,'\n');endfclose(fid);
The results I am getting look like:
%;O0000;G20;G0G17G40G49G80G90;T1M6;
When I need it to create a new line after each semi-colon
Any help is welcome
Best Answer