If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > print range of pages in unix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-04, 13:59
hsa440 hsa440 is offline
Registered User
 
Join Date: Dec 2004
Posts: 1
print range of pages in unix

hi, I want to print range of pages from file(or many files) in unix
example no. 1:
file called "A" has 100 pages :
I want to print the pages from page no 20 to page no 30

example no. 2:
files called "A" , "B" , "C" has 100 , 70, 27 pages :
I want to print the pages from page no 20 to page no 30 from "A" & "B" and print the pages from page no 20 to the end of the file in the same command line.
thanks.
Reply With Quote
  #2 (permalink)  
Old 12-20-04, 17:26
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Cool

Try using sed:
Code:
# Example 1
FR_PG=20
TO_PG=30
sed -n "${FR_PG},${TO_PG}p" MyFileA
I'm sure you can figure out the Example #2 on your own.

__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On