IMPORTANT ANNOUNCEMENT

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
#58254 - 04/21/22 06:01 PM Line Repeat with CSV Data
Uomo Del Ghiaccio Online   content
OL Expert

Registered: 02/21/01
Posts: 669
I have a CSV file with 6 lines and would like to do a repeat to build a table. The same record is being shown on every line. I have the columns in a text object with tabs
_________________________
Uomo Del Ghiaccio
--------------------

Top
#58255 - 04/27/22 08:12 AM Re: Line Repeat with CSV Data [Re: Uomo Del Ghiaccio]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
Assuming you have multiple CSV records in each data page like so:
Code:
John
Doe

Jane
Smith

Peter
Parker

You would first build your text object by adding the first name and last name variables. By default, for the data shown above, the definition for the first name variable would be set to Line 1, between columns 1 and 30.

So your Repeat operation always picks up the values from line 1, because that's how it was defined in the variable. You need to make that definition dynamic.

In my data, first names are 3 lines apart. So we need to make the line number increase by 3. To do that, set your Repeat iteration's To value to the number of CSV records you have in your data page. Then, in the definition of the first name variable, set the On line property to
Code:
=((&current.line-1)*3)+1


As each repeat gets executed, the current.line value gets incremented, resulting in the variable's definition being updated.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top