make every page 20 lines

D

DorkyGrin

I'm trying to figure out how to read through a multipage text file for
a
specific string (always in the first 3 columns of a line), then and
add X number of blank lines to make the total page length 20 lines.
There are always 7 lines of text after the string is found. These
lines need to
stay at the bottom of each page.

For example, every time I see the numbers "037", add enough blank
lines to make the total lines of that page = 20

Here a sample file, it is 11 lines long:
***********************************
033 apple asdlksdlkfdkfjlskfjlfs
pear slkdjflksdflkjdfjlksf
grape alskdfsdfdf
orange asdfasdf
037 banana asldkfjasdlk
lkasjdfljka
asdfasdf
asdfasdf
asdfasdf
ksjflkdlj
ljkisdlfkdlfk
**********************************

After running the a vb script, the file should look like this and is
20 lines long:

**********************************
033 apple asdlksdlkfdkfjlskfjlfs
pear slkdjflksdflkjdfjlksf
grape alskdfsdfdf
orange asdfasdf
037 banana asldkfjasdlk









lkasjdfljka
asdfasdf
asdfasdf
asdfasdf
ksjflkdlj
ljkisdlfkdlfk
**********************************

I was thinking of something like this:

1. count number of lines = x
2. 3. 20 - x = YlinesToAdd
4. Find "037:
5. Insert blanklines Y times.

What do you folks think?

Thanks DG
 
A

AMDRIT

My printer using portait paper with one inch margins supports 66 lines at 10
point font. Figure out how many lines your printer holds per line and
adjust accordingly.
 
D

DorkyGrin

This doesn't have anything to do with a printer. It's about making
sure each page in a
text file is exactly 20 lines and that the last 7 lines stay the last
7 lines in the
final file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top