OT: scripting, removing trailing ^L
Fairlight
fairlite at fairlite.com
Fri Dec 23 08:53:33 PST 2005
This public service announcement was brought to you by Kenneth Brody:
>
> 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
> (//)".
That's gonna nuke only the first instance on that line, I believe. It
won't nuke all because you didn't use /g but it will stop after the first
one it hits.
Since I'm not conversant in the PDF format, I didn't know if there would
possibly be more than one. He did say "extra" so the possibility occurred
to me that there could be one or more legitimate ones present. Hence, my
solution made sure to nuke -only- the final one.
mark->
--
There is no "I" in TEAM.
This would be the primary reason I've chosen not to join one.
More information about the Filepro-list
mailing list