Sponsored Content
Top Forums Shell Programming and Scripting Awk: Page number with total number of pages, EG Page 1 of 5 Post 303043187 by tugar on Monday 20th of January 2020 11:09:58 PM
Old 01-21-2020
Hi vgersh99,

Yes, it works perfectly now!
 

8 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Unix Manual (man-page) pages in HTML

LINK: Unix Manual (man page) pages in HTML http://www.rt.com/man/ : More then 100 Commands found on a Unix system mannual pages can be obtained/refered here. Good Link.. (1 Reply)
Discussion started by: killerserv
1 Replies

2. Shell Programming and Scripting

Perl find page number in a file

Hi i want to ask how can i use perl and find a word in a text file, and also telling that which page doesn't it exist? Eample: have a 10 pages text file, then i need to find 'Hello' in the file, and show that which page is it contain in. Output: Hello contains 8 times in page 1, 3, 4, 7, 10... (9 Replies)
Discussion started by: mingming88
9 Replies

3. Shell Programming and Scripting

How to input a number in a web page and pass to a script?

I am working on an embedded linux router and trying to make a webpage where the user can input a desired number of CPE and have a script update that number on the router. I have a CLI where I can log in and type the following to change that number echo "20">/proc/net/dbrctl/maxcpe which then... (7 Replies)
Discussion started by: BobTheBulldog
7 Replies

4. Emergency UNIX and Linux Support

Grab total page read from webalizer display in html

Hi, I need a way to grab the total combines since inception, total pages read from webalizer on my centos server or any other location (as long as since inception) and display the result live on my website So with each visit it would be increasing, or perhaps live (ajax) not sure But can... (0 Replies)
Discussion started by: lawstudent
0 Replies

5. What is on Your Mind?

Fedora Man Pages Reported Attack Page?

Is firefox complaining to anyone else that this is a Reported Attack Page!? I have used this site a million times and now it feels like complaining. Fedora Manpages: Home (5 Replies)
Discussion started by: cokedude
5 Replies

6. Shell Programming and Scripting

Help with sum total number of record and total number of record problem asking

Input file SFSQW 5192.56 HNRNPK 611.486 QEQW 1202.15 ASDR 568.627 QWET 6382.11 SFSQW 4386.3 HNRNPK 100 SFSQW 500 Desired output file SFSQW 10078.86 3 QWET 6382.11 1 QEQW 1202.15 1 HNRNPK 711.49 2 ASDR 568.63 1 The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies

7. Shell Programming and Scripting

Splitting of files - Addition of Page Number in the Trailer

Hi, I need your help on the following Scenario : Consider a file has 650 records and I need to split this file into 4 files having a maximum of 200 records in each of them and also for the first splitted file it should get appended with Page 1 as a trailer( Similarly for the second file, Page... (4 Replies)
Discussion started by: Ravichander
4 Replies

8. Shell Programming and Scripting

script for adding page number before page breaks

Hi, If there is an expert that can help: I have many txt files that are produced from pdftotext that include page breaks the page breaks seem to be unix style hex 0C. I want to add page numbers before each page break as in : Page XXXX Regards antman (9 Replies)
Discussion started by: antman
9 Replies
Data::Pageset(3pm)					User Contributed Perl Documentation					Data::Pageset(3pm)

NAME
Data::Pageset - Page numbering and page sets SYNOPSIS
use Data::Pageset; my $page_info = Data::Pageset->new({ 'total_entries' => $total_entries, 'entries_per_page' => $entries_per_page, # Optional, will use defaults otherwise. 'current_page' => $current_page, 'pages_per_set' => $pages_per_set, 'mode' => 'fixed', # default, or 'slide' }); # General page information print " First page: ", $page_info->first_page, " "; print " Last page: ", $page_info->last_page, " "; print " Next page: ", $page_info->next_page, " "; print " Previous page: ", $page_info->previous_page, " "; # Results on current page print "First entry on page: ", $page_info->first, " "; print " Last entry on page: ", $page_info->last, " "; # Can add in the pages per set after the object is created $page_info->pages_per_set($pages_per_set); # Page set information print "First page of previous page set: ", $page_info->previous_set, " "; print " First page of next page set: ", $page_info->next_set, " "; # Print the page numbers of the current set foreach my $page (@{$page_info->pages_in_set()}) { if($page == $page_info->current_page()) { print "<b>$page</b> "; } else { print "$page "; } } DESCRIPTION
The object produced by Data::Pageset can be used to create page navigation, it inherits from Data::Page and has access to all methods from this object. In addition it also provides methods for dealing with set of pages, so that if there are too many pages you can easily break them into chunks for the user to browse through. You can even choose to view page numbers in your set in a 'sliding' fassion. The object can easily be passed to a templating system such as Template Toolkit or be used within a script. METHODS
new() use Data::Pageset; my $page_info = Data::Pageset->new({ 'total_entries' => $total_entries, 'entries_per_page' => $entries_per_page, # Optional, will use defaults otherwise. 'current_page' => $current_page, 'pages_per_set' => $pages_per_set, 'mode' => 'slide', # default fixed }); This is the constructor of the object, it requires an anonymous hash containing the 'total_entries', how many data units you have, and the number of 'entries_per_page' to display. Optionally the 'current_page' (defaults to page 1) and pages_per_set (how many pages to display, defaults to 10) can be added. The mode (which defaults to 'fixed') determins how the paging will work, for example with 10 pages_per_set and the current_page set to 18 you will get the following results: Fixed: Pages in set: 11,12,13,14,15,16,17,18,19,20 Previous page set: 1 Next page set: 21 Slide: Pages in set: 14,15,16,17,18,19,20,21,22,23 Previous page set: 9 Next page set: 24 You can not change modes once the object is created. current_page() $page_info->current_page($page_num); This method sets the current_page to the argument supplied, it can also be set in the constructor, but you may want to reuse the object if printing out multiple pages. It will then return the page number once set. If this method is called without any arguments it returns the current page number. pages_per_set() $page_info->pages_per_set($number_of_pages_per_set); Calling this method initalises the calculations required to use the paging methods below. The value can also be passed into the constructor method new(). If called without any arguments it will return the current number of pages per set. previous_set() print "Back to previous set which starts at ", $page_info->previous_set(), " "; This method returns the page number at the start of the previous page set. undef is return if pages_per_set has not been set. next_set() print "Next set starts at ", $page_info->next_set(), " "; This method returns the page number at the start of the next page set. undef is return if pages_per_set has not been set. pages_in_set() foreach my $page_num (@{$page_info->pages_in_set()}) { print "Page: $page_num "; } This method returns an array ref of the the page numbers within the current set. undef is return if pages_per_set has not been set. EXPORT
None by default. AUTHOR
Leo Lapworth "<LLAP@cuckoo.org>" SVN
http://code.google.com/p/llap/ CONTRIBUTORS
Ryan D Johnson "<ryan@innerfence.com>" PLOBBES SEE ALSO
Data::Page. COPYRIGHT
Copyright (C) 2007, Leo Lapworth This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.10.0 2009-03-09 Data::Pageset(3pm)
All times are GMT -4. The time now is 11:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy