unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* split text in pages
@ 2005-04-05 16:51 gooliver
  2005-04-05 23:55 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: gooliver @ 2005-04-05 16:51 UTC (permalink / raw)


I have a long text-file.
How to split this text in pages with number and with this layout:

         - 2 -

bla bla bla bla bla bla    (1)
bla bla bla bla bla bla    (2)
...
bla bla bla bla bla bla    (k)

         - 3 -

bla bla bla bla bla bla    (1)
bla bla bla bla bla bla    (2)
...
bla bla bla bla bla bla    (k)

???

thanks in advance for tips!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: split text in pages
  2005-04-05 16:51 split text in pages gooliver
@ 2005-04-05 23:55 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2005-04-05 23:55 UTC (permalink / raw)


gooliver wrote:
 > I have a long text-file.
 > How to split this text in pages with number and with this layout:
 >
 >         - 2 -
 >
 > bla bla bla bla bla bla    (1)
 > bla bla bla bla bla bla    (2)
 > ...
 > bla bla bla bla bla bla    (k)
 >
 >         - 3 -
 >
 > bla bla bla bla bla bla    (1)
 > bla bla bla bla bla bla    (2)
 > ...
 > bla bla bla bla bla bla    (k)
 >
 > ???
 >
 > thanks in advance for tips!

C-x h
M-| awk 'BEGIN {page=1; line=0}
{
   if (line % 3 == 0)
     printf "        - %d -\n\n", page
   printf "%s    (%d)\n", $0, ++line
   page++
   line=line % 3
}' RET

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-05 23:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-05 16:51 split text in pages gooliver
2005-04-05 23:55 ` Kevin Rodgers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).