• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Multiple record data merge into paragraph styles-applies the wrong style

New Here ,
Nov 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

Hi, I've been working on this project for sometime and everytime I manage to get one part of the workflow to work another seems to break. My agency publishes catalogs in multiple formats: large-print, audio, braille, and HTML. I've been trying to redesing our work process so that the catalogs will be laid out from merged data out of comma-separated file. The data merges have worked fairly well in Word, but InDesign is a challenge. I'm merging multiple records on a page, like a mailing label. The paragraphs need to be formatted and I'm trying to apply a paragraph style to them. After much work, I think I've finally got the data merge to work correctly, but the wrong paragraph styles are applied. I'm going to apply a new master page to the data once the data is merge that uses the paragraph styles for text variable running headers and I need to build a table of contents based on the paragraph styles so I need this to work. Attached are some screenshots.

Master page set up for data merge with paragraph styles:

datamerge master page.gif

Here is the merged document with the wrong paragraph styles applied:

Merged document has wrong paragraph styles applied.gif

I have only a few weeks to get this process ironed out to keep to our rigorous production schedule. If anyone can help I would really appreciate it.

thanks,

Lina

Views

34.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
replies 185 Replies 185
New Here ,
Nov 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

Would either of you be willing to try with my actual spreadsheet? I'm not really sure what I'm doing wrong, but I can try sharing it out via Google drive tomorrow, if you're inclined.

thanks,

Lina

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

Yes, Please. Very Much.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2013 Nov 26, 2013

Copy link to clipboard

Copied

Okay I just tried send a private message to both of you with a link to my CSV file. I really appreciate all of your help.

Lina

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2013 Nov 26, 2013

Copy link to clipboard

Copied

Sorry, been out all afternoon, but I've been playing with your file, and I'm now totally perplexed. I get the same change as you in your file, and now I'm getting it with my file as well, and I swer that didn't happen yesterday, honest.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2013 Nov 26, 2013

Copy link to clipboard

Copied

I think this is probably expected behavior. and I need to ponder this for a bit to see if I can think of a way to fool ID into behaving differently. Maybe I can get Peter Kahrel or Jongware to join us.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2013 Nov 26, 2013

Copy link to clipboard

Copied

I heard back from Jongware who said he couldn't get the GREP to fail, but he doesn't have any experince with Data Merge, and that got me to thinking again about what I'd done yesterday. I applied the styles after the merge from a template designed for a different test. I just tried again with a text frame that had not had any connection to a data merge, and it works correctly, so it seems ther's something about the data merge itself that screws things up. I smell a bug, or maybe "feature."

Just checked, and the problem is the find change behaves exactly the same as the remove blank lines -- it doesn't delete the field markers, and they have the styles attached.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 26, 2013 Nov 26, 2013

Copy link to clipboard

Copied

Now if anyone knows a way to get Find/Change to find the field markers....

If you copy and paste them into the dialog they come in as ~I (index markers, I think), but then ID doesn't find them because they aren't really index markers.

AAAAAAARGHHHH!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 27, 2013 Nov 27, 2013

Copy link to clipboard

Copied

Happy Thanksgiving to you all! I will try when I'm back in the office on Monday to reach out to a professional that I know that is particularly good with InDesign GREP and see if he can help us find a solution. I will definitely let you all know when I find a solution.

best,

Lina

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

@Peter Chater – I don't know, if you already read about it in the InDesign Scripting Forum, but there is a way to find the index markers with TEXT Search ( not with GREP search !!! ).

 

The special character that composes an index character in these circumstances is "<FEFF>" for a TEXT Search.

 

Did not test it in the UI, but the following script should work:

 

var aDoc = app.documents[0]; 
app.findTextPreferences = app.changeTextPreferences = null;

app.findTextPreferences.findWhat = "<FEFF>";
app.changeTextPreferences.changeTo = "";

aDoc.changeText();
app.findTextPreferences = app.changeTextPreferences = null;

alert("done");

 

Hopefully "<FEFF>" is not used for any other markers as well.

And: you're absolutely right about the "AAAAAAARGHHHH!"…

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

Uwe,

I didn't test your script yet, but since you can find Index markers using the ~I in the GREP dialog, (and that's what's pasted in if you copy the merge field marker), yet you get no matches when you search for the pasted marker I'm not sure it is going to help. We are after all, looking for merge field markers rather than index markers, and I think I may have introduced a red herring by mentioning that's what pasted in.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

@Peter – of course it's all about "Merge Field Markers". In my oppinion <FEFF> should work.

See the following thread in the Scripting Forum (maybe the title is a bit misleading??):

Jean-Claude Tremblay

Remove All InDex Markers in empty cells

http://forums.adobe.com/thread/1344419?tstart=0

And: it does not work with GREP search. Seems to be a bug…

Is there a test file (IDML) available?

Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

I'll send you a package...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

@I did a quick test with the material you sent me. Just tested with InDesign CS5.5 (on Mac OSX 10.6.8, all German versions). No problems here. The right paragraph styles were applied. And the left over special characters could be deleted with my script snippet from answer #42.

I'll send you the results as IDMLs via mail.

By inspecting the results, I noticed a glitch with Umlauts:

"Grass Günter" was transferred to "Grass G¸nter".
FWIW: it should read: "by Günter Grass" and not "by Grass Günter"…

That's already wrong in the CSV file. To overcome the Umlaut problem, the CSV file should be saved as Unicode (UTF16). Don't know, if Excel is responsible for that.

Just tested with a set of 12 data sets. Maybe that's a "problem"? Ok. I will test on and let you know…

Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

Interesting. Here the formatting is preserved by local override to the Genre paragraph style. Looks, correct, but it won't work for things like TOC or running header variable.

The script did absolutley nothing in CS6, US, Windows. I'll try in CS5.5.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

I thought I had mentioned the local override in 5.5...

Is there a way to find/change, grep or otherwise, a paragraph override and change the formatting to the Title style?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

Hm. Maybe I have not looked close enough, but I cannot detect any overrides to the paragraph styles on my end here…

NoOverridesOnMySide.png

Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

Laubender wrote:

Hm. Maybe I have not looked close enough, but I cannot detect any overrides to the paragraph styles on my end here…

Nope, It works fine if you run the script first. I'm an airhead today. That's also why the names you mention are out of order. I sent you a mockup of Lina's template that I made myself, not the one she's using, and I either switched the order of the first and last name fields, or I forgot to put a comma between them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

Yeah, I like the script! Many thanks, Uwe.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

AH!

I figured out what I was doing wrong. I must be half asleep still.

The script DOES work, perfectly. I was expecting to see a change, but all it is doing is removing the markers (and yes, it does remove all the field markers). You still need to run the GREP find/change after the script to remove the lines.

Any chance you might cobble up a script to do both parts for Lina? It would save her a step.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

By the way, I just want to point out that this is a great example of how well this forum can work when we work together.

Thank you, both Mike and Uwe, for the time you've devoted to this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

Another, half-cobbled means AND using Remove Blank Lines, is to have the Title style set to an off-color, such as Magenta.

Then the Find/Change can look for the Genre paragraph style + the Magenta color. In the Change box, simply set it to the Title paragraph style.

Love a challenge.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

Any chance you might cobble up a script to do both parts for Lina? It would save her a step.

@Peter – should be no problem.
But I have to look at that later in the evening…
(around 6 pm right now here in Germany)

Basically, I think all the problems in that case are tackled.

Just some double blanks left, some empty blanks at the beginning of paragraphs and the empty paragraph returns… 😉

Uwe

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

That would be great. I would limit the script to removing the markers and removing lines that are either empty or have only whitespace in them. I think it's probably best to leave double-spaces to Find Change By List or some other technique. No telling what you've discovered that's really my error in template construction.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

@Peter Chater – I needed a break…


Here my script snippet that does:

 

1. A TEXT Search: Special Character "<FEFF>"/Replace: "" (Empty string = remove found instance)

 

2. A GREP Search: "whitespace at the beginning of a paragraph (including empty paragraph signs)"/Replace: "" (Empty string = remove found instance)

 

//Scope:
var aDoc = app.documents[0];

//Step 1:
app.findTextPreferences = app.changeTextPreferences = null;

app.findTextPreferences.findWhat = "<FEFF>";
app.changeTextPreferences.changeTo = "";

aDoc.changeText();

app.findTextPreferences = app.changeTextPreferences = null;


//Step 2:
app.findGrepPreferences = app.changeGrepPreferences = null;

app.findGrepPreferences.findWhat = "^\\s+";
app.changeGrepPreferences.changeTo = "";

aDoc.changeGrep();

app.findGrepPreferences = app.changeGrepPreferences = null;

alert("Done!");

 

Regards,
Uwe Laubender
( Adobe Community Professional )

 

EDITED: Set script's code to the forum's editor script tags.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2013 Nov 28, 2013

Copy link to clipboard

Copied

And it works perfectly here.

One important thing to remember -- DO NOT remove blank lines during the merge. Let the script do it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines