I have an InDesign document which is filled from the data in a CSV file using data merge. The CSV has columns for First Name, Middle Name & Last Name, but some of the data in the CSV isn't filled in - such as Middle Name if the person doesn't have one. InDesign then leaves a physical space when the middle name is missing which is putting a double space between the first and last name when I merge the data. Is there any way to get InDesign to ignore blank cells in the CSV file?
Are you sure those spaces exist in your CSV file? They shouldn't.
Did you not manually added the spaces between the fields?
Like this: (dots represent spaces)
It does make sense since you want a space between fields.
A solution (among many possible ones) is to use a grep style to hide a space if followed by another space. Something like this should do the trick:
To create an invisible character style, you can use these settings ("Invisible character style" is just like pancakes: everyone has his own recipe... here's mine ^ ^):
color : [none]
size: 0.1 pt
horizontal scale: 1%
See example below:
In the Data Merge menu, choose "Content Placement Options", and select "Remove Blank Lines for Empty Fields", then click "OK" - it should work.