One solution is to delete this line as a whole and use the file system to track the creation / change date. This can be done in many ways using common shell tools:
# sed sed -i file.eps '/^%%CreationDate: /d'
or
# grep grep -v '^%%CreationDate: ' file.eps > tmp && mv tmp file.eps
If you are on a Windows computer, MATLAB should include a Perl interpreter:
# perl perl -i -ne 'print if not /^%%CreationDate: /' file.eps
From within MATLAB, you can do the following to invoke a single-line Perl program:
%# construct command, arguments and input filename (with quotes to escape spaces) cmd = ['"' fullfile(matlabroot, 'sys\perl\win32\bin\perl.exe') '"']; args = ' -i.bak -ne "print if not /^%%CreationDate: /" '; fname = ['"' fullfile(pwd,'file.eps') '"']; %# execute command system([cmd args fname])
source share