Copy link to clipboard
Copied
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!!!
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:
Now, in every cell (in that column), that had a
...Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I would remove the comma and the space between the fields, then go back to the spreadsheet and add <comma-space> before each title.
Copy link to clipboard
Copied
Does InDesign actually interpret that correctly where relevant? Whats the difference between typing " ," or "<comma-space>"??
Copy link to clipboard
Copied
Ack...should have made it clearer...I did mean to say type a comma and a space before each title.
Copy link to clipboard
Copied
Oh ok.... dang it - I thought I was on the cusp of a whole new level of InDesign possibilities... *sigh*
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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:
Now, in every cell (in that column), that had an entry, the entry will be preceded by a comma and a space.
Copy link to clipboard
Copied
Thanks John! That does speed up having to edit each entry. I still am interested in how to use the paragraph style to achieve this as well.
Copy link to clipboard
Copied
Russell PROCOPY wrote:
I still am interested in how to use the paragraph style to achieve this as well.
Well, the primary point of concern with that is you'd have to give up the idea of having the Name and Title on the same line. (If they're 2 different paragraph Styles, they'll have to be 2 different paragraphs.) So I think Bob was just suggesting that you could solve the comma and empty-record issues by changing your destination formatting from [ Name, Title ] to something like this:
Name
Title
Copy link to clipboard
Copied
Ah, I though there was a function within the paragraph style window that provided a conditional text option. Now I understand. Yeah, again unfortunately the client is very specific in the layout from fonts to point size to how the data is to display from line to line.
A sampling of the clients instruction below on a few of the items. My next objective is to find a way to automate if a line is larger then the text box to reduce in size to fit within the line width rather than having to go back and edit the merge for each one the goes out of the text block. Thanks again for the help!
Attendees
Course Director
Faculty
Copy link to clipboard
Copied
Russell PROCOPY wrote:
My next objective is to find a way to automate if a line is larger then the text box to reduce in size to fit within the line width rather than having to go back and edit the merge for each one the goes out of the text block.
Well, that's surely not the preferred approach as dynamically-sized text, as you describe, is "uncontrolled," will be noticeably inconsistent with text that doesn't dynamically resize, and end up out-of-client-spec.
Personally, I'd recommend finding the worst case and making it work (using a condensed font, tighter tracking, increased column-width, etc.), then basing all your formatting on it. Even so, if you ultimately decide to set up dynamic-resize anyway, there's no InDesign-native feature for that. You'd need to get the scripts from this page to make it happen.
Copy link to clipboard
Copied
Make sense. I usually just take the overset text report and manually go through adjusting the tracking and then font size when needed. But again when you have a merge that can contain several thousand items it can become overwhelming. Job security I suppose... Thanks again for all the help!
Copy link to clipboard
Copied
@Russell PROCOPY
Well, actually there is an option for conditional text, but it can't be applied as part of a paragraph or character style. It can be applied as part of a Find/Change. So, it could be possible to search for space/comma/space or whatever your repeating string would be and apply the condition to turn it off.
I'd have to see your work and layout to absolutely know if this could be done. And that's the kind of consulting work I get paid for.