The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
ksh scripting help praveenbvarrier Shell Programming and Scripting 1 04-15-2008 11:19 AM
sql scripting help sam786 Shell Programming and Scripting 3 12-10-2007 12:31 PM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 09:12 AM
scripting guru's pls help me with scripting on AIX thatiprashant Shell Programming and Scripting 1 01-20-2006 07:58 PM
Scripting? woofie What's on Your Mind? 1 03-09-2005 07:03 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-02-2008
scrappycc scrappycc is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 6
Question Need help with KSH scripting

Hi I need to insert a page break into a file based on matching a phrase in the file. I am doing this with a ksh script on a Unix box.

Any help would be greatly appreciated.

Thanks
  #2 (permalink)  
Old 04-02-2008
unilover unilover is offline
Registered User
  
 

Join Date: Mar 2008
Location: Toronto, Canada
Posts: 66
What do you mean? Where in the file? what match?
  #3 (permalink)  
Old 04-02-2008
scrappycc scrappycc is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 6
I have a file that has Page 2 (and 3, 4, 5, 6 and so on) at the top of the page. I need to insert a page break so that my report will actually break where the "Page #" is listed. Right now is just printing out filling the page based on what the my print command would output.

Like this......

<insert page break here>Page 2
some text......
<insert page break here>Page 3
some text......
<insert page break here>Page 4
  #4 (permalink)  
Old 04-02-2008
unilover unilover is offline
Registered User
  
 

Join Date: Mar 2008
Location: Toronto, Canada
Posts: 66
Try:
Code:
sed 's/Page /^LPage /' file.txt >newfile.txt

  #5 (permalink)  
Old 04-02-2008
unilover unilover is offline
Registered User
  
 

Join Date: Mar 2008
Location: Toronto, Canada
Posts: 66
For the Form-Feed character (i.e. "^L") you have to key [Ctrl]V followed by [Ctrl]L
  #6 (permalink)  
Old 04-02-2008
scrappycc scrappycc is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 6
I just keeps add the text of ^L to my file instead of the actual control character of line/form feed. UGH!!!!
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 09:07 AM.


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