15 Replies Latest reply on Jan 13, 2017 12:41 PM by Sandee Cohen

    Data Merge Unwanted spaces and commas

    Russell PROCOPY Level 1

      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!!!

        • 1. Re: Data Merge Unwanted spaces and commas
          BobLevine MVP & Adobe Community Professional

          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.

          1 person found this helpful
          • 2. Re: Data Merge Unwanted spaces and commas
            Eternal Warrior Adobe Community Professional

            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.

            • 3. Re: Data Merge Unwanted spaces and commas
              John Mensinger Adobe Community Professional & MVP

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

              • 4. Re: Data Merge Unwanted spaces and commas
                Eternal Warrior Adobe Community Professional

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

                • 5. Re: Data Merge Unwanted spaces and commas
                  John Mensinger Adobe Community Professional & MVP

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

                   

                  • 6. Re: Data Merge Unwanted spaces and commas
                    Eternal Warrior Adobe Community Professional

                    Oh ok.... dang it - I thought I was on the cusp of a whole new level of InDesign possibilities... *sigh*

                    • 7. Re: Data Merge Unwanted spaces and commas
                      Russell PROCOPY Level 1

                      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.

                      • 8. Re: Data Merge Unwanted spaces and commas
                        MW Design Level 5

                        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.

                        • 9. Re: Data Merge Unwanted spaces and commas
                          John Mensinger Adobe Community Professional & MVP

                          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.

                          2 people found this helpful
                          • 10. Re: Data Merge Unwanted spaces and commas
                            Russell PROCOPY Level 1

                            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.

                            • 11. Re: Data Merge Unwanted spaces and commas
                              John Mensinger Adobe Community Professional & MVP

                              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

                              • 12. Re: Data Merge Unwanted spaces and commas
                                Russell PROCOPY Level 1

                                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

                                • First Name on the top line, Last name, Degree on Second line, and City, State on the third line.
                                • First Name – Arial, 32size font, Bold
                                • Last Name, Degree – Arial Black, 36size font
                                • City, State – Arial, 32size font

                                 

                                Course Director

                                • First Name on the top line, Last name, Degree on Second line, and City, State on the third line.
                                • First Name – Arial, 32size font, Bold
                                • Last Name, Degree – Arial Black, 36size font
                                • City, State – Arial, 32size font

                                 

                                Faculty

                                • First Name on the top line, Last name, Degree on Second line, and City, State on the third line.
                                • First Name – Arial, 32size font, Bold
                                • Last Name, Degree – Arial Black, 36size font
                                • City, State – Arial, 32size font
                                • 13. Re: Data Merge Unwanted spaces and commas
                                  John Mensinger Adobe Community Professional & MVP

                                  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.

                                  • 14. Re: Data Merge Unwanted spaces and commas
                                    Russell PROCOPY Level 1

                                    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!

                                    • 15. Re: Data Merge Unwanted spaces and commas
                                      Sandee Cohen Adobe Community Professional

                                      @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.