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

Removing line-feed characters from a text file.

Thread Next
David Buddrige
December 18, 2002 21:48
Removing line-feed characters from a text file.
Message ID:
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:

	$_ =~ 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.


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

thanks heaps

David Buddrige

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About