The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 04:22 AM
Three feed plugins for WordPress iBot UNIX and Linux RSS News 0 04-07-2008 04:40 AM
S-231: Adobe Form Designer and Form Client Vulnerabilities iBot Security Advisories (RSS) 0 03-27-2008 10:10 AM
Disable form feed on a serial printer connected to Sco OpenServer scoman2 UNIX for Dummies Questions & Answers 0 06-28-2005 12:25 PM
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 03:58 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-30-2003
johnny_woo johnny_woo is offline
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
  #2 (permalink)  
Old 10-31-2003
oombera's Avatar
oombera oombera is offline Forum Advisor  
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 (permalink)  
Old 10-31-2003
johnny_woo johnny_woo is offline
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 (permalink)  
Old 10-31-2003
Vishnu Vishnu is offline
Registered User
  
 

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

tr -d "\f" <filename>

warm regards,
Vishnu
  #5 (permalink)  
Old 10-31-2003
johnny_woo johnny_woo is offline
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 (permalink)  
Old 10-31-2003
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
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 06:17 AM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:35 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0