Page 1 of 1
How to specify number of lines per page?
Posted: Mon Apr 21, 2008 6:38 am
by unwatched
Hi,
I'm working on a transcript; I need the text to be 25 lines per page, with an automatic page break after 25 lines. Is it possible to do? If so, how?
Thanks in advance.
Posted: Mon Apr 21, 2008 8:24 am
by ACRobin
I am sure it is possible and there at least two ways of doing what you want.
A page beak character is a form feed - character 12 is ASCII (0x0C in hex).
My solution would be to write a macro to move down 25 lines and insert a page break (Edit - Insert - Page Break). I would then run this macro until end of file.
A crude solution but will work.
I am sure there will be a way to do the same using a regular expression.
Posted: Fri Apr 25, 2008 6:44 pm
by HerNameWasTextPad
ACRobin wrote:A crude solution . . . would be to write a macro to move down 25 lines and insert a page break (Edit - Insert - Page Break).
With all due respect, ACRobin, yours is not a crude solution. It is an intelligent solution and, in fact, THE solution, as this is not a job for regular expressions.
It is no accident that the creators of TextPad have implemented a macro facility. Macros are very useful.
Posted: Fri Apr 25, 2008 7:56 pm
by ben_josephs
This is very much a job for regular expressions. But TextPad's regex engine is too weak to do it. WildEdit's one can do it.
Yes, macros are useful, but far less useful than a scripting facility.
Edit: Corrected typo.
Posted: Fri Apr 25, 2008 8:39 pm
by HerNameWasTextPad
ben_josephs wrote:WildEdit . . . can do it.
Right . . . but at the moment "unwatched" appears to be in need of a quick TextPad solution, so "macros to the rescue!"
Posted: Tue Apr 29, 2008 5:24 am
by HerNameWasTextPad
- Before running the macro, don't forget to take the word wrap off manually (Ctrl+Q, W), for each file that is to be processed
- When recording the macro, don't forget to press "Home" after inserting the Page Break character, so that the cursor will be ready for the macro's succeeding iteration