The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Page feed in Troff dpmore UNIX for Dummies Questions & Answers 2 05-18-2008 01:22 AM
Three feed plugins for WordPress iBot UNIX and Linux RSS News 0 04-07-2008 01:40 AM
S-231: Adobe Form Designer and Form Client Vulnerabilities iBot Security Advisories (RSS) 0 03-27-2008 07:10 AM
Disable form feed on a serial printer connected to Sco OpenServer scoman2 UNIX for Dummies Questions & Answers 0 06-28-2005 09:25 AM
Changing Unix form to Microsoft Word form to be able to email it to someone. Cheraunm UNIX for Advanced & Expert Users 8 05-24-2002 12:58 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-30-2003
Registered User
 

Join Date: Oct 2003
Posts: 3
Form Feed...

Hi,


I've a text file that has a formfeed character at the beginning.
I want to get rid of this formfeed character using sed.

But I don't know how to specify the formfeed character.
I've tried \014 (octal for formfeed), \f but still not works.


Regards,


Johnny
Forum Sponsor
  #2  
Old 10-30-2003
oombera's Avatar
Registered User
 

Join Date: Aug 2002
Location: Cleveland, OH
Posts: 804
There've been quite a few posts on removing control characters.
Here's a couple:

Removing carriage return characters from file
getting rid of control characters
  #3  
Old 10-31-2003
Registered User
 

Join Date: Oct 2003
Posts: 3
Hi, oombera,


Thanks for the information.

Actually I use ORACLE SQLPLUS to generate
a text file with form feeds before each page
(including the 1st page).
So I want to get rid of the FIRST formfeed so as
not to waste a piece of paper.

I try to use sed with a command

1s/\f//

but does not work.


Regards,


Johnny
  #4  
Old 10-31-2003
Registered User
 

Join Date: Aug 2002
Location: Marlboro, MA
Posts: 114
try...

tr -d "\f" <filename>

warm regards,
Vishnu
  #5  
Old 10-31-2003
Registered User
 

Join Date: Oct 2003
Posts: 3
Hi, Vishnu,


Thanks for the information.

But tr -d "\f" will remove all FF,
not just the FIRST FF.


Regards,


Johnny
  #6  
Old 10-31-2003
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
If the form-feed is within the first 10 lines, try....
Code:
sed '1,10s/^L//' file1 > file2
....where ^L is Ctrl-V Ctrl-L

OR

To remove only the first line-feed in the file, try....
Code:
awk '/\014/&&f<1{sub("\014","");f=1};1' file1 > file2

Last edited by Ygor; 10-31-2003 at 03:17 AM.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0