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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert blank line after each \f\r

Status
Not open for further replies.

dbase77

Technical User
Apr 23, 2002
591
IE
Hi,

I have a file which contains \f\r. How do I go about inserting blank line after each occurrence of \f\r?

I used this to replace \r with \f\r. Now I want to insert blank line after it.

nawk 'NR%94==0{sub(/\r/,"\f\r")}1' $x > /tmp/$filename.temp

Thanks.
 
nawk 'NR%94==0{sub(/\r/,"\f\r[!]\n[/!]")}1' $x > /tmp/$filename.temp

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV. How could I forgot about \n.

I've used this to insert blank line but only if the line is blank. If the line is not blank, it won't insert it. Anyway I can change it to insert blank line whether it contain text or not. Thanks again.

awk '{print}NR%98==0{print ""}' /tmp/$filename.temp2 > $x
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top