Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Regular Expression - pattern for page break

Status
Not open for further replies.

citysurfer

Technical User
Apr 4, 2005
1
HK
This is an extremely basic question, but I need a regular expression to insert a page break.

The pattern needs to search a text file for the following characters: 31<<<

Where this occurs a page breaks need to be inserted.

 
Code:
$body_text=~s/31<<</<whatever you use for a page break>/g;
--Paul



cigless ...
 
usually the page break for text files is like this
Code:
$body_text=~s/31<<</\f/g;
if it is a foo.txt you will see a control char for a page break, but if it is a foo.doc you will see the difference cause it will change pages.

TIMTOWTDI
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top