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 Styles Quick formatting help

Return to Member Forum

  • Author
    Posts
    • #1251592
      Stan Cain
      Member

      I have a bunch or records something like this: (01 0104-070-1100B AND A PROPERTY 3 LLC)

      Based on the Amazing help that I got last time from David and Aaron I was able to formulate a crude expression to select everything that I need selected, which is everything after the
      01 and before the company name. I used 0+(\d\d\d)-0+\d\d-(\d\d\d\d) Now I would like to put that same selection back, But Without the 2 Dashes and Add a space after the last number and before the company name, EXAMPLE (01 01040701100 B AND A PROPERTY 3 LLC)

    • #1251634
      David Blatner
      Keymaster

      Stan, I encourage you to check out some of the resources on this page for GREP help:
      https://indesignsecrets.com/resources/grep

      In general, here’s the rule: If you put something in parentheses in the Find What, then you can use it in the Replace With.

      For example, let’s say I search for (\d\d)(\d\d) and replace it with $2-$1. And my text includes 1234. After the find/change the text will read 34-12

    • #125173
      Stan Cain
      Member

      Thanks for your response David, I was actually able to figure out most of it by doing some research here and theres only 1 Issue that I cannot figure out, after I have the number formatted like this: 000000098 01 31110331730ROBER ARENA I Cannot find a way to select and add the space at the end of the number string between the beginning of the Name/company.

      I use (Space) 0+(\d\d\d)0+\d\d(\d\d\d\d) and change to $0 (space)
      and it works on some of the records but not others.

    • #125174
      David Blatner
      Keymaster

      Instead of using a specific number of digits, I find it more useful to use “one or more, shortest match”, such as (\d+?)(\u)
      That will find one or more digits followed by an uppercase letter.

    • #125175
      Stan Cain
      Member

      That actually is not working because some of the names are like this with numbers
      000000079 01 02050801120250FLORIDA INVEST LLC $527.06
      The actual company name is 250 FLORIDA INVEST LLC so the space would need to be added between 2 numbers

    • #1251984
      Stan Cain
      Member

      In all of the records, there is always 11 Numbers (digits) before the name begins

    • #125189
      Aaron Troia
      Participant

      Stan,

      Since you said there are always 11 before the numbers in the address, I think we can work from there without slecting the whole line, try this,

      Find: (\d{11})(\d+)(?=[A-Z])
      Change: $1 $2

      This is finding and grouping exactly 11 digits (\d{11}) that have a space before, then grouping any digits that follow those 11 digits (\d+) and to be sure we have a lookahead assertion (which is zero length group so we dont need to add a $3 group) to make sure there is a letter from A-Z (?=[A-Z]).

      Make sure you make a copy of your file before you test this, or run it on a few and see how it goes. I would hate for it to need a little more tweaking before it was right for what you need and mess up any content.

      Aaron

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