Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: 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.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •