I'm modifying raw PCL/PS files (mixed) and for some reason I can't get my Sed syntax right for the true beginning that I want it to grab. Here's a sample output from the strings command:
*c50B *c0P &f1X &f7y4X %-12345X%!PS-Adobe-3.0 EPSF-3.0 <------Sed doesn't work for this pattern %%Creator: tiff2ps <----Sed works for this pattern [data...] %%EOF
Here's my sed command that works:
sed -n '/%%Creator/,/%%EOF/p'
But I want it to start with %-12345X%:
sed -n '/%-12345X%/,/%%EOF/p'
When I do the last command, it just outputs the entire file. No combination from that line works. Now, I'm viewing the raw print file with 'strings', could it be that that line is encoded in a way that sed can't understand? Any idea on working around this?
Edited to add:
I'm pretty sure this has to do with the encoding of PCL and line escapes. The file goes from PCL to PS, and doesn't create the first message of PS on it's own line. Output of cat looks like this:
*c50BESC*c0PESC&f1XESC&f7y4XESC%-12345X%!PS-Adobe-3.0 EPSF-3.0 %%Creator: tiff2ps