Adobe® InDesign® Data Merge and TextStitch – An Unexpected Partnership

Our free TextStitch plug-in is now 17 years old, and still going strong – first released in 2007.

TextStitch for Adobe InDesign

In its own right, it’s a helpful plug-in. It allows you to quickly unthread and re-thread text frames in Adobe® InDesign® – faster than you can do with click-shiftClick-shiftClick…

Data Merge

As it so turns out, and unexpectedly to us, TextStitch has become quite popular with users of Adobe InDesign Data Merge.

Data Merge is a great tool, but in some cases, it is not as efficient as it could be.

The idea behind Data Merge is that every data record in the data set is mapped to an Adobe InDesign text frame. One record = one text frame.

That is great for creating business cards or catalog pages, but it is troublesome when you want the data merge to create running text – a single text story containing all the merged records.

Here, TextStitch comes in handy. The trick is to

  • First run the data merge, into a fresh document. This creates a number of text frames, each text frame containing a single record.
  • Then run the TextStitch Auto-Stitch function over the whole document. This will ‘thread’ all the text frames throughout the whole document.
  • Then delete all text frames except for the very first one. All the data is now ‘bunched up’ into that first text frame – pretty much everything is now overset text.
  • Now, make the first text frame larger and/or use the Adobe InDesign text flowing tools to automatically add pages as needed.

Demo

Below a small demo to help visualize this trick.

I have a spreadsheet with some fictitious data records:

The first thing I do is to export this data into a format Adobe InDesign Data Merge can understand. I’ll use File – Save As… and export to UTF-16 Unicode Text (.txt).

This format will retain the accented characters in a cross-platform-compatible way.

Meaning: I could create the .txt on a Mac, and then run the Adobe InDesign Data Merge on a Windows machine, or vice versa, and the accented characters in the data will come out OK.

For this simple demo, I will use a brand new document created in Adobe InDesign 2025.

First I bring up the Data Merge panel in Adobe InDesign by way of the Window – Utilities – Data Merge menu.

I click the hamburger menu on the panel and use the Select Data Source… menu item to select the UTF-16 file that I exported from Excel.

The column names are extracted from the file and show up in the Data Merge panel:

Next, I create a text frame and start dragging the column names from the Data Merge panel into the text frame. After each drag, I hit the Tab key, so the items being dragged in are separated by tabs. This adds three ‘magical strings’ into the text frame: <<Name>>, <<Email>>, <<Phone>>.

If I want to, I can then adjust the tab widths, using the Tabs panel, to give the columns a bit of breathing space.

Now, on to the Data Merge. I select Create Merged Document… from the hamburger menu on the Data Merge panel.

The only thing I change on the next dialog is to set Records per Document Page: to Multiple Records, then click OK.

If all goes well, I end up with a merged document. Depending on the number of records in the Data Source, there might be many pages.

Where TextStitch Comes In

Now the issue: the merged document is filled with ‘loose’ text frames, each frame containing a single merged record.

What I really want is a single ‘flow’, a single story that contains all of these records.

To make that happen, I have TextStitch installed.

Step 1: I configure TextStitch to stitch all frames in the whole document. I select the API – TextStitch – Configure and change the Auto-Stitch/Unstitch option to Throughout the document.

Step 2: I select API – TextStitch – Auto Stitch and allow it to stitch all frames.

Now, all the text frames will be threaded together. I can see this by turning on View – Extras – Text Threads and selecting one of the frames.

Step 3: Now I delete all the text frames, except the very first one. If the Data Merge created multiple pages, I simply delete all added pages, except the first page, then delete all remaining text frames, except the very first. This causes overset text, and that’s OK.

The trick relies on the fact that deleting threaded text frames does not delete their content.

The content of the deleted frames is simply ‘bunched up’ into the preceding text frame on the thread.

Step 4: To retain the look-and-feel of the document, TextStitch has inserted break characters between the individual records. I now use the Edit – Find/Change… menu item to find and replace all occurrences of ^R (Frame Break) into either ^b (Standard Carriage Return) or ^p (End of Paragraph).

Now all merged records are within a single story. For smaller number of records, all I need to do is resize the text frame.

For larger amounts of data records, I can use Adobe InDesign’s Smart Reflow over multiple pages using the standard Adobe InDesign text flow features (more info here: https://creativepro.com/master-indesigns-smart-text-reflow/).

This entry was posted in Uncategorized. Bookmark the permalink.