Skip to main content
Participating Frequently
January 13, 2017
Answered

Data Merge Unwanted spaces and commas

  • January 13, 2017
  • 4 replies
  • 6852 views

Hello All

I am doing a data merge that contains the following fields

i.e., <<NAME>>, <<TITLE>>

Some people do not have titles. Is there a way to remove the left behind comma and space in this situation?

Thanks!!!

This topic has been closed for replies.
Correct answer John Mensinger

Russell PROCOPY wrote:

Unfortunately, it would not be easy to change the spreadsheets. We do not create them and they are customer supplied and there are usually thousands of entries.

It would be much easier than you're thinking, and will only take a few seconds.

Assuming you're using Excel:

  1. Select the <Title> column
  2. Right-Click and choose Format Cells
  3. On the number tab, select Category: Custom
  4. In the Type: field, type , @ (that's comma, space, AT)
  5. Click OK

Now, in every cell (in that column), that had an entry, the entry will be preceded by a comma and a space.

4 replies

Participating Frequently
January 13, 2017

Thanks for all the replies. Unfortunately, it would not be easy to change the spreadsheets. We do not create them and they are customer supplied and there are usually thousands of entries. So really not an option.

The paragraph style option sounds good but I am not very familiar with how this would solve the issue, mostly because I do not use paragraph styles. I have no clue how I would achieve using it to add or remove the needed space and comma.

Any help would be appreciated.

MW Design
Inspiring
January 13, 2017

Like in another thread I am about to post into, consider InData, a plug-in by Em Software. There can be condititional statements that would add the comma and title field where appropriate and leave it out if there is no data for Title (or whatever).

I wouldn't consider doing merges without that plug-in.

However, you can post-process the merged ID file to remove the commas.

John Mensinger
Community Expert
Community Expert
January 13, 2017

I would remove the comma and the space between the fields, then go back to the spreadsheet and add <comma-space> before each title.

Eternal Warrior
Inspiring
January 13, 2017

Does InDesign actually interpret that correctly where relevant? Whats the difference between typing " ," or "<comma-space>"??

John Mensinger
Community Expert
Community Expert
January 13, 2017

Ack...should have made it clearer...I did mean to say type a comma and a space before each title.

Eternal Warrior
Inspiring
January 13, 2017

I was going to suggest that you could always use a GREP style to essentially make the comma look like it has disappeared?

But on second thought I would take BobLevine's attack approach instead as it will make a neater/cleaner data merge.

It would be good if InDesign supported IF/ELSE statements etc as you could do so much more with it.

Also without going too OT - InDesign needs its own GREP/Conditional styling that can be used either for the whole document or as part of a character/paragraph style so you can add/delete things not just change visual aspects.

BobLevine
Community Expert
Community Expert
January 13, 2017

I would attack that with a different paragraph style for each and lose the comma. Choose Remove Blank Lines For Empty Fields to ignore the empty data source.

Alternatively add the comma to the name.