5 Replies Latest reply on Jun 27, 2017 12:48 AM by Loic.Aigon

    DataMerge Question


      I know there is a way to remove any blank lines while using datamerge, but is there a way to remove text that belongs with the placeholder?


      For example.


      I have a business card with 3 numbers. they are laid out like this "tel <<tel>> ext <<ext>> fax <<fax>> mobile <<mobile>>"


      My question is how to get rid of "ext" or "fax" or "mobile" if there isn't one in the excel file?



        • 1. Re: DataMerge Question
          CIA_design Adobe Community Professional

          Hello, i'm trying to be good with my English !!!


          In the data merge you have an option "Remove blank line when empty"


          Merge data to create form letters, envelopes, or mailing labels in Adobe InDesign


          I hope you Will inderstood everything

          • 2. Re: DataMerge Question
            HolidayPP Level 1

            That's sort of what I am looking for. I already knew about this.


            Basically i want to be able to remove a piece of STATIC text if it doesn't have a VARIABLE text to go with it. i.e. tel (static) 000.000.0000 (variable). So if there is no number for tel, then i want tel to be removed.


            Clear as mud? lol

            • 3. Re: DataMerge Question
              Jeffrey_Smith Most Valuable Participant

              I don't have a solution to the issue, but here is a workaround method:

              1. In the data file, for any field that does not have data, enter "xyz"

              2. In the Indesign master merge document, create a character style with the following attributes: .1pt size, .1 pt leading, color: no fill

              3. For the paragraph style that is used for the numbers, create a GREP that will find ext: xyz, fax: xyz, mobile: xyz and apply the character style from step 2.


              Although the actual data is not technically removed during the merge, it basically makes these areas invisible.

              • 4. Re: DataMerge Question
                Migintosh Level 4

                What if instead of changing the data to small with a different color, the OP used Find/Change to find the placeholder and delete it. It might look something like this:


                tel <<tel>> ext <<ext>> fax <<fax>> mobile <<mobile>>


                tel (123) 555-1111 ext 987 fax (123) 555-2222 mobile (123) 555-3333

                tel (123) 555-4444 ext 987 fax xyz mobile (123) 555-5555

                tel (123) 555-1111 ext xyz fax (123) 555-2222 mobile (123) 555-3333


                Find: fax xyz (and a space, if you want to remove extra spaces between fields)

                Change: (leave this field blank)


                Then change fax in the Find field to the next placeholder that has xyz and repeat. This is what you get, with no placeholders removed that you didn't want removed.


                tel (123) 555-1111 ext 987 fax (123) 555-2222 mobile (123) 555-3333

                tel (123) 555-4444 ext 987 mobile (123) 555-5555

                tel (123) 555-1111 fax (123) 555-2222 mobile (123) 555-3333


                If you have separators like paragraph returns, commas, Em dashes, etc., include them in the Find. I don't have to do any complicated things with GREP, but I think you can do this in one go, instead of doing it for each placeholder one-at-a-time, but I'm not sure of the code. Maybe someone can provide it.

                1 person found this helpful
                • 5. Re: DataMerge Question
                  Loic.Aigon Adobe Community Professional

                  If you have recurrent needs in terms of directories, you should envision more professional datamerge solutions. Of course some tricks will help but sooner or later you will have more issues to adress and no solutions for that.

                  In your case, it's really easy to condition a static text visibility to some variable value thanks to EasyCatalog. And guess what if the client updates its data and then fill in a previously blank value, the static text will automatically reappear.

                  I find it pretty comfortable because you don't have to go and check for every single occurrences