Computing.Net > Forums > Unix > awk remove form feed

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

awk remove form feed

Reply to Message Icon

Name: ltonisma
Date: May 6, 2004 at 01:16:40 Pacific
OS: HPUX 11.0
CPU/Ram: hpux
Comment:

Hi!
I need to create a awk script to remove 2 form feed marks from the beginning of the file. To make sure it will not print 2 empty pages.
I cannot make it work.
The output will be putting all form feed lines in th begining...
Please Help!
-- Begin Script
{
if (FNR<=2) {
if ( substr($0,1,1)=="\f" ) { print substr($0,2) }
}
else { print $0 }
}

Thanks,Linda



Sponsored Link
Ads by Google

Response Number 1
Name: Wolfbone
Date: May 6, 2004 at 02:45:15 Pacific
Reply:

FNR <=2 {sub(/\f+/,"",$0)} ; {print}

maybe.


0

Response Number 2
Name: ltonisma
Date: May 6, 2004 at 03:14:31 Pacific
Reply:

Thank you so very much ,Wolfbone!
It works!! :)
Take care,Linda


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: awk remove form feed

How to compare form feed? www.computing.net/answers/unix/how-to-compare-form-feed/6817.html

How to delete ^M character using vi www.computing.net/answers/unix/how-to-delete-m-character-using-vi/2451.html

A script to share www.computing.net/answers/unix/a-script-to-share/6848.html