develooper Front page | perl.beginners | Postings from December 2002

Removing line-feed characters from a text file.

Thread Next
From:
David Buddrige
Date:
December 18, 2002 21:48
Subject:
Removing line-feed characters from a text file.
Message ID:
3E015CC0.8070404@switch.aust.com
Hi all,

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

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

and

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

thanks heaps

David Buddrige


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About