I'm having a problem with sed syntax.
So far I can sed the HiResBoundingBox to capture the images I want and output to pdf.
But now ever so often I get an illustrator file that has hexadecimal values at the start and end of the file.
Imagemagick powers through this and still creates the rastorized previews I want but the gs dies using the epstopdf script to output the vector files.
If I hand remove the hex on both ends of the file, both functions work fine and the file can still be managed in illustrator but if I resave it the hex comes back.
No idea where it comes from or why. It only happens on a few files plus it seems to serve no purpose as the files work perfectly without it.
I can not get the sed statement to work. I've tried a blue million variations with no luck. Copied some that I found, same result.
Start of bad eps file:
Quote:
ÅÐÓÆ ^@^@^@5O
^@^@^@^@^@^@^@^@^@UO
^@ím^K^@ÿÿ^@^@%!PS-Adobe-3.1 EPSF-3.0^M
|
The way I need it to look:
Quote:
%!PS-Adobe-3.1 EPSF-3.0^M
|
End of file the same:
Quote:
%AI9_PrivateDataEnd^M
@ @
|
just needs to be :
Tried
Quote:
sed -n '/%/,$p' < = blank file
sed -i 's/%/,$!d/g' = same
sed 's/%/,$!d/g' = same
sed 's/%/,$!d' = same
|
I can't seem to find any proper reference to this.