Script for data merge?
Copy link to clipboard
Copied
I am working on a complex document to create labels for various clothing items. The document is linked to a .cvs file with a lot of data fields, and the total number of data items (or pages that will be created when merged) is around 16,000 pages. Everything is set up to merge correctly as far as I know, but the issue I'm having is that each different clothing style is designed as a different color (so all the data fields would be a different color on every page). I know I could make changes to the source document and have multiple master pages, but that's just not feasible with the thousands of different items. Ultimately I would end up with thousands of merged documents which is just not doable. The only other method I'm seeing is to merge the one document and then make color corrections to every page (again thousands of pages to go through, so not very efficient!) Is there a way to add a script to the .csv file to indicate which items should be which color that will override the indesign target document color setting?
Copy link to clipboard
Copied
Interesting! Screenshot, please! 😉
Copy link to clipboard
Copied
So here is an example; this is from the merged document. The size that is written in magenta is what needs to change; the color should match the colored bar on the left. Is there a way to indicate that in the .csv file that you know of? I am pretty new to using data merge; I've only used it for basic uses so I'm not too familiar with how to set up the .csv file.
Copy link to clipboard
Copied
e.g. on Page 1 to 3 you what to have color#1 on labels
on Page 4 to 5 you what to have color#2 on labels
??
Copy link to clipboard
Copied
A "label" little screenshot could be helpful! 😉
Copy link to clipboard
Copied
Hi przemek, do you have anything in the csv file that identifies the colour for each specific label? If so then it would be a easy property to apply through a script.
If it isn't in the csv then a random or sequential list of colours could be applied.
Copy link to clipboard
Copied
Is there a way to indicate the color in the .csv file? I don't have anything like that yet, but it sounds like that's the best way to accomplish this. I'm pretty new to using the data merge feature; could you explain how to add that to the .csv and apply a script?
Copy link to clipboard
Copied
How many colors have you? 😉
Copy link to clipboard
Copied
There are 13 different colors. But like I mentioned originally, there are thousands of items, so when I create the merged document, I'd have to go through every page and change that text box that says what size the clothing is to the correct color. Do you know of a way to do this with a script from the csv file? I am pretty new to using the data merge feature and don't really know anything about scripts. Could you explain how to do that if there is a way to incorporate it into the csv?
Thanks,
Copy link to clipboard
Copied
I think it's very simple to play! [good news!] 😉
What is your source file? Excel?
Copy link to clipboard
Copied
Yes, excel is my source file saved as a .csv
Copy link to clipboard
Copied
OK! So, it's very simple to play.
In Excel, add a new column to define colors and a second column to make a concatenation [ColorXX_…]
sample: 100% Cotton => Color01 [Cyan60%]
In ID, play as with a simple grep style and a simple regex x 13 times (for each color).
Create the 13 regex and put it in a Multi-Find/Change set.
So play the game in … 1 click! 😉
Copy link to clipboard
Copied
Thanks for your help with this issue. I'm not quite understanding 100%...I'm very new to using data merge and have never used grep styles or regex so I haven't been able to make this work yet but I'm getting close. Can you help me with the formula for the source file? Here is a screenshot of it. So the cells that need to change colors are:
SIZE | S1 | S2 | S3 | S4 | WAIST | MEASUREMENTS |
Copy link to clipboard
Copied
It's simple too to make formulas in Excel! Have you already done it?
Copy link to clipboard
Copied
No, I haven't done it in excel yet, I don't understand how to write the formula. This is the error I'm getting with the formula I've tried. I'm not sure why it's not working.
Copy link to clipboard
Copied
Can you send me your Excel file with only the 2 first lines? I'll write for you what you'll need as Formulas, columns, …
Just for you to copy and paste your data in the modified Excel file after I send it to you in return! Easier to help you! 😉
Copy link to clipboard
Copied
Here is a sample of my source file; just the first few lines.
Thanks so much for your help! Sorry I don't understand much....I'm still
pretty new to the data merge feature.
On Mon, Sep 28, 2015 at 1:12 PM, Obi-wan Kenobi <forums_noreply@adobe.com>
Copy link to clipboard
Copied
Hi Tyson,
16k pages…You should definitively consider EasyCatalog. That would make your life far easier
FWIW,
Loic
www.ozalto.com
Copy link to clipboard
Copied
Obi-Wan Kenobi, you have almost completely solved a long-standing issue that I have but you've left me sitting on the edge of my seat with anticipation. Could you please share the Excel formula you created for tylyn? I Googled until my eyes were bleeding before I decided to ask you but I can't find exactly what works. Thank you so much for your help!
Copy link to clipboard
Copied
Hi,
I've forgotten what I've done for tylyn! What do you want to do yourself?
Copy link to clipboard
Copied
I need to do the same thing that tylyn was asking about- change the text color in various Excel (.csv) cells that will translate through data merge for InDesign. I would really like to use your Excel concatenation technique but I cannot figure out the right formula to use to make that happen.
I'm attaching a screencap to show you what I'm looking to do. I removed 20+ columns that are unrelated to this question so this is a dumbed down version of my original .csv file. If you could just get me started on the formula then I can change the variables as needed. Excel is not my strong suit so I am stuck on the concatenation formula. I know I'm not going to color code the actual words in Excel, I just did it this way to show you the approx. colors that they need to be.
I have been frantically trying to figure this out before I head out of town for a long weekend but it just didn't happen. If you would be so kind as to get me started then I would really appreciate it. I will back in town in a couple of days so I'll check back then. I just wanted to let you know this so you don't mistake my lack of response as lack of appreciation for your help.
Copy link to clipboard
Copied
That is exactly right; A few pages will have one color which coordinates with a certain clothing style; then the next few pages will be another color indicating a new style. Here is a screenshot (the size that is written in magenta is what I'm trying to change to match the colored bar on the left).

