David Buddrige wrote:
> 
> Hi all,

Hello,

> I have a bunch of C++ source files that have had form-feed characters
> inserted in them every so often.  In vi and emacs these characters
> appear as ^L.  I am wanting to write a short perl script that will pull
> out these characters; I am thiking of something like:
> 
> while(<INPUT>)
> {
>         $_ =~ s/^L//g;
> }
> 
> However, I am not sure how to specify the form-feed character - I am not
>   even sure if it is specifically a "form-feed" or if it is some other
> character that may be used to signify end-of-page.  Does anyone have an
> idea of

If you find a control character in a file represented like ^L you can
represent it in perl with the \cL escape sequence.

s/\cL//g;
# or
tr/\cL//d;


> a) How to determine the exact value of a non-printable character in a
> text file.

perldoc -f ord


> and
> 
> b) how to specify it in a search/replace?

For any character use an octal representation (s/\014//g) or a
hexadecimal representation (s/\x0C//g)



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to