In an EXCEL or XML/JSON file I have stored the contents of learning cards: one column for front side of the card, one column for the back side of the card. I want the cards to be layouted in Adobe Indesign and thought of the merge data function. Problem is: if I convert the EXCEL file into CSV in order to import it in Indesign, I lose the formatting of the text (just basic styles like bold and italic). But unfortunately Indesign is not able to merge data of an EXCEL file. Is there any other way to populate the cards from the file automatically? Maybe by a script or so? Or maybe by rewriting the existing file into another format?

2 Answers 2


As a matter of fact, you can't retrieve styles from Excel to Indd.
Good practice is to style up your data variables in INDD, very easy to do.
Just apply paragraph (or character) styles to your variables.

INDD data merge

  • Well, that's a good answer! At least for the paragraph styles – for the bold character styles inside a paragraph (i.e. a formatted paragraph in one variable), this isn't working.
    – Madamadam
    Feb 7, 2017 at 15:09
  • Correct! .csv and .txt don't keep formatting. You could "wrap" your styled text with "tags", then use GREP rules in indesign in order to style text placed between your tags and hide your tags. Don't have time to show it now, maybe someone else could.
    – Vinny
    Feb 7, 2017 at 15:50
  • 1
    I.e. place @ before and after your bold text (may be easier with a macro), then use this GREP nested style: (?<=@).*?(?=@). Apply Bold style to it. Then Add a new GREP nested style to make @ invisible (size 0.1pt, no color, kerning -1000)
    – Vinny
    Feb 7, 2017 at 16:01
  • Using GREP is also a very good idea! I always asked myself what this function is for – now I know.
    – Madamadam
    Feb 9, 2017 at 11:16

So, I think I have an answer for your "second question" about how to deal with local formatting, like Bold or Italic.

The most efficient way to use styles in InDesign is to set your text using paragraph styles, and then wherever you need to change the formatting of individual characters, use a character style to make that change (i.e. instead of going to the text menu and choosing "bold" you would go to the character styles menu and choose the bold character style.) Once you have text formatted using a character style, you can later apply a paragraph style (or change the existing paragraph style), and the character formatting will remain.

I was just listening to an old episode of the InDesign Secrets podcast last night and they were were talking about the Perfect Prep Text script, which I think could solve your problem. Basically what it does is to search your text looking for local overrides (like bold and italics) and then automatically creates and applies character styles to this locally formatted text. So, you would import your text from Excel, then run the script to capture all of the local formatting as character styles and then apply the paragraph styles.

When I went to the InDesign Secrets website to find the link for Perfect Prep Text, I saw another script that seems to do the same thing, called Preserve Local Formatting, and you can find it on this page. In both cases, you will have to scroll down into the linked pages to find the hyperlink to the script itself. I believe both scripts are available to download for free (although I am a member of the website, so I couldn't test).

If you aren't familiar with scripts and how to use them, this page from InDesign Secrets will walk you through the process.

Okay, well @Vinny pointed out that I had misread the comments above, and you can't pull formatting across in a merge process (which is how I thought it worked, but thought I read something different in your question and the comments).

Another option that might work well for you is to try using nested styles. Basically the way nested styles work is that you identify a specific landmark (lots of options available: maybe a comma, an n-dash, a tab character, etc.), and then tell InDesign to apply a specific character style until it finds that landmark, and then to apply a different character style after the landmark. What's nice is that nested styles are built into a paragraph style definition, so once you get the paragraph style set up correctly, you can apply it to your imported text and the entire thing gets correctly formatted without any additional work.

This is similar to the way the GREP style that @Vinny mentioned works, but it wouldn't require that you add the formatting elements via macro. If the construction of your document doesn't allow you to define a particular landmark character, you should definitely experiment with GREP styling, because it is super powerful. Once you get either nested styles or GREP styles set up correctly, using them seems like magic!

  • Magerber, unfortunately this just can't work in a data merging process. No formatting is allowed in a csv or txt file.
    – Vinny
    Feb 7, 2017 at 22:26
  • That's what I thought, but I thought I read something different in the comments above.
    – magerber
    Feb 7, 2017 at 23:26
  • Glad it might help you. I love sharing the nested styles functionality with people who don't know about it, because it is so darn exciting when you get things set up correctly, and just a click of one button allows you to correctly format an entire document. smile
    – magerber
    Feb 9, 2017 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.