Indesign Data Merge Question

orka81

Member
I have an excel file with simple info to place into indesign using data merge.

the fields are Salutation, first name, last name, address, city, state, zip, so that it might read:

Mr. John Smith
123 Main Street
Anytown, IN 46554

the salutation is optional, so this field may be blank or filled with 'Mr.' 'Mrs.' and so on.

when i run data merge on it, i set up a space between the salutation and first name, and so on.

if page 1 has a salutation, it previews fine, if page 2 does not, then there is an extra space before the first name, so that it will read:

<space> John Smith
123 Main Street
Anytown, IN 46554


is there an easy way to get rid of that extra space that does not require manually removing it?

thanks in advance

orka81
 
You can just add space after prefix and not before name. Something like this:
Mr.<space>
That way if you have prefix, there is a space before name, if you don't have prefix, name is first without space.

I hope this helps.
 
Yes Zoran is right, but not in the Indesign file, the space needs to be in your data base txt or csv file. That way there will not be a space when a the Salutation is not used and a space when used.
 
If the .csv file is supplied by the client, and they have not allowed for this space (I'm assuming that the space is placed AFTER the salutation in the salutation's cell), then that would require a huge task of adding it in manually, to the .csv file, wouldn't it? Not a big deal with just a few entries, but with 50,000 that might take some time...
 
In the Data Merge "Content Placement Options" pallete just check the box that says "Remove Blank Lines for Empty Fields" and that should solve your problem?

Hope I have understood your question correctly.

Lee.
 
We need to do this all the time, but as far as I know there is no simple way of doing it in InDesign.

"Remove blank lines" does just that, but does not deal with an empty field on the same line as another, non-empty, field.

Best to fix it in Excel. Create a new column and use the formula:

=TRIM(salutation & " " & first_name & " " & last_name)

Obviously use cell references instead of "salutation" etc. and ensure you have a space between the quotation marks.

Replicate the formula down the column; copy the column to the clipboard; paste as values; export as CSV, tab-delimited or whatever, then use the new field as the Name line.

Chris
 
Open CSV file in Excel, pick the column that has the salutation--the whole column.

Now open the find command (Windows ctrl F, Mac cmd F) then pick Find and Replace.

In Find field type a period (.); in the replace type period and space (. ) -- do not type parenthesis.

Then press the Replace All and in all the salutations, a space will be placed after the periods. This takes seconds.

Hope this helps.
 
In Excel you could also build an Expression in another field to merge the Prefix with a space
Example: =CONCATENATE(A1," ")

After you have done this. You need make all of the other records have the same calculation.
 
pcmodem,

When Excel file saved as CSV or TXT format, will the "Expression" you gave transfer the space info?
 
As long as you open the file in Excel, you can use the Expression. Then when you save the file as anything other than an Excel document. The value will be saved, not the expression.
 
pcmodem,

Thanks for the info. I looked at Excel's Help about the expression and it was kinda over my head. I'll just have to study it a little more and with God's help I'll maybe understand it--I am humbled once again.
 

PressWise

A 30-day Fix for Managed Chaos

As any print professional knows, printing can be managed chaos. Software that solves multiple problems and provides measurable and monetizable value has a direct impact on the bottom-line.

“We reduced order entry costs by about 40%.” Significant savings in a shop that turns about 500 jobs a month.


Learn how…….

   
Back
Top