• 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.1K

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
Community Expert ,
Nov 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

Can't really tell from those screen shots what styles are applied to the placeholders....

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 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

Peter- All the styles on the screen have been applied.  The data has been merged onto 7 lines and each line has it's own paragraph style. But I think the problem is that some of the fields are empty and don't have data in them. The fields merged are below next to the paragraph style that they are supposed to be merged into:

<<GENRE>> (Genre)

<<SUBJECT_CODE>> (Subject Code)

<<TITLE_ARTICLE>><<TITLE>>(Title)

<<BN>> <<HRS>> hours<<MINS>> minutes (Time)

<<ROLE>> <<AFN>> <<ALN>> <<CONJ>> <<CFN>> <<CLN>> (author)

read by <<NFN>> <<NLN>> (narrator)

<<ANNOTATION>> (annotation)

The problem seems to occur because the Genre and Subject Code fields don't always have data in them and then somehow the Genre style is applied to the Title paragraph.

-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
Valorous Hero ,
Nov 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

Lina,

Would you paste two records, one with all info and one without, into a post? Saves making stuff up (I'm lazy).

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 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

Here is the first record with all the fields filled:

Adult Fiction

Adventure

TheJungle: The |Oregon| Files

DB73147 11 hours1 minutes

by Clive Cussler  

read by Mark Ashby

A powerful thirteenth-century weapon called the Dragon’s Stare falls into the hands of a man intent on using it to bring down the U.S. government. Ex-CIA operative Juan Cabrillo and his crew on the |Oregon| race to foil the plot. Some violence and some strong language. Bestseller. 

Here is a record where the first two fields are empty:

TheGirl Who Fell from the Sky

DB73112 5 hours28 minutes

by Heidi W. Durrow  

read by Annie Wauters

Eleven-year-old Rachel and her siblings leave their black G.I. father when Nella, their Danish mother, moves them to Chicago in pursuit of Nella’s lover. Forced to live with her black grandmother and aunt in Portland, Oregon, after tragedy strikes, Rachel struggles with her identity. Bellwether Prize. Bestseller.  2010.

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 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

Ah, I see from the copying and pasting that there's a space I need to adjust in the data merge template.

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 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

Comparing the paste of data to the screen shots...man, there's a lot of pieces in individual fields. It is gonna take a little bit to reconstruct a spreadsheet.

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 22, 2013 Nov 22, 2013

Copy link to clipboard

Copied

I'm not really trying to reconstruct my spreadsheet or the csv file. I got the data to merge in fine, all 536 records, I'm just trying to figure out why the paragraph styles don't adhere correctly. I don't believe that it's a problem with the comma-separated data.

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 23, 2013 Nov 23, 2013

Copy link to clipboard

Copied

I know you have the CSV...but if I want to replicate what you are doing to help, I have to remake the spreadsheet from the merge data as presented in the thread. Easier if the data in the thread was from the spreadsheet rather than post merge.

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 23, 2013 Nov 23, 2013

Copy link to clipboard

Copied

I am sending you a Private Message with a download link to a sample. Please respond in this thread as to whether it helps you or where it is going wrong.

I was up for almost 24 hours and hit the hay early last night. I think I might have seen what I think is a problem last night if I hadn't been so tired.

You are tagging the merge fields. Out of curisoity, why?

The ZIP file I have linked to in a PM has an ID CS6 file and IDML (don't know what version for sure you are using), the tab delimited merge I used, and the Excel file. Likely I got fields wrong/misplaced going from the pasted data to a spreadsheet.

Mike

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 23, 2013 Nov 23, 2013

Copy link to clipboard

Copied

Hey, I can upload the spreadsheet for you, but I am not at work so I'll

have to do it on Monday. I need to put the merge fields into paragraph

styles because the whole rest of the publication formatting depends on the

data being in paragraph styles, I will use them to build a table of

contents and running headers with variable text elements.

thanks for your help and I will upload the sample on Monday.

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
Valorous Hero ,
Nov 23, 2013 Nov 23, 2013

Copy link to clipboard

Copied

Lina--did you check your PM and download, look at the sample file I provided? All is in parahraph styles with the exception of the character style used in the line:

DB73147 11 hours1 minutes

The hours/minutes text is the character style. You do not need to use Tagging. Just style the merge fields with the paragraph styles.

capture-000776.png

Mike

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 23, 2013 Nov 23, 2013

Copy link to clipboard

Copied

Hey, I'm not intending to tag the paragraphs in XML tags, just trying to put them in paragraph styles. But you and Peter make a good point. I will check the formatting in Story Editor view when I get back in the office to see if it lines up correctly. I will also look at your zip file and upload a copy of the spreadsheet.

Thanks for all of your efforts. I truly appreciate 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 23, 2013 Nov 23, 2013

Copy link to clipboard

Copied

Lina,

Do check the tags panel. The reason is because those colored brackets that can be seen in your screen shot are tag brackets used for mapping styles to XML nodes.

No worries. We'll figure it out together on Monday. Have a restful remainder of the weekend.

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 24, 2013 Nov 24, 2013

Copy link to clipboard

Copied

I was wondering what the brackets were. They highlight exactly where the

data field are merged into the template. Hopefully all will be revealed

tomorrow.

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 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

Mike,

I downloaded your file and ran the data merge on it and ran into the same problem: when merged the second record has the Genre paragraph style applied to it rather than the Title paragraph style applied to it. I tried to send you a ZIP file of it before I realized that there's no way for me to attach a file. Here's a picture of the merged file.

Paragraphstyledatamergeerror.gif

Still I will check my own file in the Story Editor mode and make sure that all the paragraphs are properly formatted.

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
New Here ,
Nov 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

If this helps at all, here is a picture of the data merge template Master page in Story Editor view:

datamergemasterinstoryeditor.gif

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 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

Okay so I've finally figured out where the error is! The data merge is applying the paragraph styles to the empty fields. See the screen capture below. Is there a way through GREP or search and replace to delete those paraph styles with only empty spaces in them?

paragraphstyles applied to empty fields.gif

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

In my testing here it didn't do that (though that was what I surmised was happening to you back in post 14), so I think it should not be happening, but the XML tags are somehow getting in the way.

Mike is knowledgable in XML, and I am not, so lets wait and see what he has to say.

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 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

I don't remember this happening in past versions. But I mainly use XML. And a quicky test converting your file to XML worked fine (and besides, it ends up all in continuous text frames...).

I don't do much GREP. But you can do this via a Find/Replace.

First, in your main document, you can delete the tags--but do this on a second copy of your working file!

Change your Content Placement options to not remove blank lines (these are in the Datamerge panel).

capture-000780.png

Then after the merge, change the format of the two blank lines at the beginning of the records without the two lines of data:

capture-000778.png

Note the Change Format style is changing those two paragraphs to Title.

Then rerun the find to remove the two blank paragraphs.

capture-000779.png

I suspect this can be done easier. I am sitting awaiting an appointment and cannot go much further than this for now, sorry.

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

If you don't remove blank lines from the merge, I think all that's necessary is to remove blank paragraphs. No need to mess around with changing any formatting.

You can do that by GREP using Find ^\r and leave the change field blank. That looks for a paragraph return as the first character in the paragraph.

Using Find ^\s*\r will also find paragraphs with nothing but blank space in them, or multiple empties as a single block (\s also includes \r as a match).

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 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

Hey, first time I successfully logged in using my phone since the reset...

Peter, removing the blank lines alone has the title line and style change to the genre style with local formatting. I don't have access to 5.5 or earlier with my laptop so I cannot try in previous versions until tonight.

Is there a means to search for the locally styled genre style and change it 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 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

Mike,

IF each paragraph has the correct style applied (and at this point that may be a big IF, since it may be the XML tags overriding the styles),

AND the blank lines are not removed during the merge,

THEN the Find/Change operation with the queries I posted above should not be changing any assigned paragraph styles in the merged document, so if the Title line had the Title style applied before Find/Change, it will have it after as well.

Your previous files that you sent to me did not use discreet styles the same way they are arranged in the screen cap of the story editor, and that might be part of the problem.

Going out for awhile, but I should be back in a few hours.

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 25, 2013 Nov 25, 2013

Copy link to clipboard

Copied

Looking forward to your return...

Merge file...

capture-000781.png

After merge, before removal of blank paragraphs...

capture-000782.png

After removal of blank paragraphs using ^\r (and other F/R methods)...

capture-000784.png

This was using 5.5, same result in CS6.

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

Mike,

That sure isn't what I see here...

Here's a .csv file I made to test concatenation with commas inthe fields, along with a merge template, and a somewhat edited merged doc (with blank lines and some style changes inthe first frame, but you can play any way you like): https://www.yousendit.com/download/OGhjYUp3aFJiV3pIRHRVag

Whe I run either of the queries from above I end up with the correct styles. Are you sure you cleared the change formatting? It should be empty, as should the find formatting.

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