OT: scripting, removing trailing ^L
Kenneth Brody
kenbrody at bestweb.net
Fri Dec 23 08:44:45 PST 2005
Quoting William James McEachran (Fri, 23 Dec 2005 11:19:16 -0500):
> Slightly off-topic.
> The data comes from filePro, some of it passes thru 'gnuplot', and in
> the end the gnuplot graph is incorporated into the filepro output form.
> The whole thing then is converted with 'pcl6'/ghostpcl into a PDF file
> Result, a PDF file with data & a graph.
>
> gnuplot adds an unneed "^L" to the end of the graph pcl file. I've got
> to come up with a way to remove just this one character at the end of
> the file. I've got a mental block on removing just the final character.
>
> sed? awk?
I believe that you can do something like:
sed "$s/^L//" <file >newfile
where "^L" is an actual Ctrl-L. (There is probably a way to represent
Ctrl-L with a backslash-code, but I can't think of it offhand.)
This says "on the last line ($) substitute Ctrl-L (/^L/) with nothing
(//)".
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list