MATLAB: File manipulation

multiple files

Dear Matlabians
I have done a script that takes csv and txt files manipulates them and produces a final xls with the data in those files. Each time i take on specific file and then I continue to the next one.
But sometimes there is some files that the data in there are wrong. In my script I have found a way to check this and I know which files will be wrong. And I have made the script to stop at those points
The question is: Is there a way during the script is stop to open the file which is wrong to maniputale it by hand (delete the data that are wrong) then save the file again and make the script to restart for this file and continue as it suppose to continue
Thank you

Best Answer

Yes. Use try-catch and keyboard() to control the program flow.
try
ProcessFileForTheFirstTime();
catch
keyboard;
% Outside MATLAB, OpenTheProblematicFile();
% Outside MATLAB, ManualEditAndSaveFile();
ProcessFileForTheSecondTime();
end
The keyboard() function can be used to pause your program till you type return.