Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

GREP – removing space within string

Return to Member Forum

  • Author
    Posts
    • #100624

      We have many thousands of spaces to remove from catalog pages and looking to automate but not getting the code right for GREP. Here is an example of our current format: #ERT93 8765. (# sign, three uppercase letters, two digits, space, 4 digits). We want to remove the space so it reads #ERT938765. I am thinking I need to create two found text fields (the part before space and the part after the space) and then put those Found Fields in the Change field. Or maybe look aheads/look behinds?

      I am having a hard time figuring out how to select that second part of the string as we have many number in our catalog and don’t want to inadvertently replace the wrong thing. Another tricky part is that we also have some other variations of our item numbers, which don’t need to change but could be problematic using the Find/Change feature. They include the following examples: #ERW91-345 (5 digit with a hyphen), #ERW9-104 (4 digit with a hyphen), #ERW51654 (4-5 digit number, no space). Can anyone help? Thanks in advance.

    • #100626
      Graham Park
      Member

      Try
      Find
      (\#\u{3}\d{2})(\d{4})
      Change
      $1$2

    • #100627

      Perfect!! That worked, thank you so much!!

Viewing 2 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads