Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how-to with sed

Status
Not open for further replies.

timatlee

Programmer
Jan 5, 2007
1
CA
We have an old accounting system that runs on a Unix host (circa 1980 or so). Some of the print-outs start with a form feed character, and some don't. This form-feed character is causing some significant issues with our document management software, as the DMS can't decipher what kind of document it is - since the first page of the document is always blank!

I've been able to get SED to replace all instances of a character in a document, but that's a bit too broad... and my eyes are starting to go buggy from reading man pages.

So my question is: How can I use SED to strip out the first instance of a form-feed character (0x0c)?

Thanks in advance!

 
You may try something like this:
a=`echo "\f\c"; sed "1s!$a!!" /path/to/input > output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top