I have a large document with 200 pages and a .csv file with 200 records. What I want is to assign every record to a page in numeric order. So first page has first row, second page - second row etc. Is this possible with scripting? If so, how can I start writing my script. Any tips appreciated.
Because data merge uses one page to export all the records. And I have 200 pages and 200 records. If I use data-merge I would end up with 40000 pages in pdf
That doesn't make sense. I use Data merge all the time with designing Real Estate listing ads and it doesn't do that.
This is a document with csv linked:
This is when I export it:
If your main frame occupies the whole page and that you asks for single record per page, you should get what you want, i.e. not 40k pages.
I ask for single record per page. But I don't have a main frame. Could you elaborate? What's a main frame? Thank you a lot
By default, Data Merge places one record per page - you need to work really hard to get more than one record per page 😉
Just create ONE TextFrame on your page, insert all fields in required order inside this ONE TextFrame - and generate final document.
I have one record per page. I have 200 records and 200 pages. I don't want to put all of the data in one frame, it defeats the purpose of my work. I just want to export 200 pages instead of 40000.
Yes, one TextFrame will hold one record.
I looked at the sample file.
It looks to me as if you are trying to take the same records and rearrange them on each page of your template file so you've made multiple pages in the template. You are always going to get a final file that has one page per record times the number of pages in the template.
Since you haven't shown us any real data and a real template sample I can't say if what you want to do is possible with DataMerge, but most likely if it can be done you will need to re-design your data file so that all of the information for each field is included in your spread sheet and in the order you eant it to appear on you pages,
so instead of columns Apples, Oranges, Bananas with numbers in each cell you will need Line 1, Line 2, Line 3
with data row 1: Apples: 11, Oranges: 100, Bananas:7; data row two: Oranges: 0, Bananas: 2, Apples : 6; data row 3: Bananas: 3, Apples: 7, Oranges: 3
You would then set up a dingle page template that has your fields in the order Line 1, Line 2, Line 3 and the merge will give you one page per record, sorted in rolling order bcause your data is sorted in rolling order.
Thank you so much. I also think this is impossible with data merge. Unfortunately, I can't change it the way you propose, because not only I have 200 pages (and probably many more documents in the future) but also around 30 columns in my spread sheet. I've just taken a glance at InDesign scripting documentation and I could try using find and change function instead of data merge. Maybe I'll manage to write a script so it changes text on a certain page from a certain row.
Again, without seeing something real I can't say much.
DataMerge is a very basic, dumb, function sutable for doing things like adress labels, award certificates and directory listings. There are some commercial plugins for catalog construction that might do better for what you need.