These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#58022 - 05/28/21 12:26 PM Script to add blank lines
LizzieD Offline
OL Newbie

Registered: 05/25/21
Posts: 4

I'm looking for a way to ad blank lines so that it makes up a certain number.

Waht I need it to split a file containing several items (PlanetPress images I need to create).

Within these lines, I need to find some text that will give the file its name (customer number).

As I have to search throuh that file, I need to add blank lines so that they all have the same number of lines otherwise data are all shifted and my condition always returns false except for the first item.

As an example, I have a file that contains 5 items to create 5 pdfs. Because item 1 may have 58 lines, item 2 may have 61 and so on, I cannot set it up to say it has 60 lines as when I fraction it, my variable 4 that searces on line 12 will be correct but when I fraction it, variable 4 will be completely wrong.

So I was thinking of rewriting the file so I give it the same number of lines for each item.

Does that make sense? It is a good way? If so, any example how to do it?

Is there another way of doing it?

Thanks very much for your help

#58025 - 05/31/21 01:13 PM Re: Script to add blank lines [Re: LizzieD]
jouberto Offline
OL Toddler

Registered: 04/18/18
Posts: 50
Hi Lizzie,

Rewriting your data into a consistent number of lines per page is indeed one way to do it, but depending on the actual file format and contents, there might be much simpler ways of achieving this. For example, if each page is separated by form feeds in the data, you could use an emulated data splitter that cuts pages on form feeds instead of line counts. The length of each page would become irrelevant. There could be many options based on your scenario so I'd recommend you open a support ticket so we can provide the simplest way to proceed with your resources.

#58028 - 06/01/21 09:41 AM Re: Script to add blank lines [Re: jouberto]
LizzieD Offline
OL Newbie

Registered: 05/25/21
Posts: 4
Thanks for your reply.

I'm going to open a ticket.

I tried to change emulation and to to FF character and then fraction it to one page but it doesn't seem to work. That's why I was thinking of rewriting the file but I'd rather use out of the box functionalities