I need to strip leading FormFeed characters from files as they are printed. Unfortunately, there are PCL commands at the beginning of the file which must be preserved. Also, other FormFeeds throughout the file should be preserved.
So, the task is to find and eliminate FF (ASCII 0c) only if it occurs within the first 80(?) characters.
To illustrate, consider this HexDump of a report:
I need to eliminate that "0c" at character position 31. The exact position will vary. Can I use sed to change the first instance of 0d0c to 0d only? This needs to be invoked within the printer interface script, so the source would be STDIN, and the output would be STDOUT.
So, the task is to find and eliminate FF (ASCII 0c) only if it occurs within the first 80(?) characters.
To illustrate, consider this HexDump of a report:
Code:
0000 0d 1b 26 6c 30 6f 32 61 36 44 1b 28 31 30 55 1b ..&l0o2a6D.(10U.
0010 28 73 70 31 30 68 31 32 76 73 62 33 54 0d 0c 31 (sp10h12vsb3T..1
0020 30 2f 31 37 2f 30 35 20 20 20 20 20 20 20 20 20 0/17/05