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

deleting ^L in text file 1

Status
Not open for further replies.

jawon

Programmer
Feb 6, 2003
31
US
I have a text file that shows ^L. I'm guessing this is a page break because when I mailx it and I try to print the email, I get multiple pages. How do I get rid of it? I know I could just use sed and if that's true, how do I identify that character?
 
# just for debuggin' - substituing with '<ff>'
# in bash
sed -e &quot;s/$(echo -e '\f')/<ff>/g&quot; file

# in other shells
sed -e &quot;s/`echo '\f'`/<ff>/g&quot;


vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Try this:
Code:
ff=`echo &quot;\014\c&quot;`
sed -e &quot;s!${ff}!!g&quot; FileName.txt >FileName.tmp &&
mv FileName.tmp FileName.txt

Hope This Help
PH.
 
You could also use tr to delete all instances of ^L (ascii octal 014) in your file...

tr -d &quot;\014&quot; file1 > file2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top