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 help

Return to Member Forum

  • Author
    Posts
    • #75555
      Luis Mira
      Member

      Hello all. I hope someone out there can help me.
      I have a huge list of sentences that i need to break at a certain point and it’s very time consuming to do it manually. I´ve been trying to use grep, but to this day i´m unable to find an expression that works (newbie).
      What i have is: sentence of all caps, space, normal word
      Example: ALL CAPS SENTENCE Word

      What i need is to break the sentence at the final of the all caps
      Example: ALL CAPS SENTENCE
      Word

      Is it possible to do this with grep?

      Thanks in advance!

    • #75558
      Masood Ahmad
      Participant

      Hi Luis, try this using GREP Find/Change:

      Find What: (^[\u ]+\.?)([ ]+)
      Change to: $1\r$2

      Please let me know if it works…

      • #75559
        Masood Ahmad
        Participant

        Or
        Find What: (^[\u ]+\.?)([\u ]+)

    • #75560
      Luis Mira
      Member

      Hi Masood.
      Thank you for your answer but it doesn´t seem to work. I´m using CS6.
      If it helps, after “Word” there other “words”. The sentences are long, but i need the break in the first “Word”, as stated above.

      Thanks again.

    • #75561
      Masood Ahmad
      Participant

      Luis, based on the text you gave in the starting, I created a code and tested it in CS6. If it is not working for you, then please supply some more text, lets say three to four paragraphs.

    • #75562
      Luis Mira
      Member

      The second “find” kinda works. Some sentences it breaks well others it breaks the caps in half.
      example: ALL CAPS
      SENTECE Word.

      Is it because some letters in the all caps contains “/” ?
      Example: ALL C/APs

    • #75563
      Luis Mira
      Member

      Here’s some lines:

      TOMATE REDONDO Cal. 67/82 KG 1,99
      PEPINO KG 1,79
      RÚCULA SELVAGEM Emb. 100g UN 1,69
      SALADA PREMIUM Emb. 200g UN 1,59
      CALDO VERDE Emb. 200g UN 0,89
      HORTÊNSIA Vaso 17cm UN 4,99

    • #75564
      Anonymous
      Inactive

      Not sure if this works in CS6 but you can try

      (u+s)+Kul+

      Change to

      \r$0

    • #75565
      Anonymous
      Inactive

      Obviously should only be 1 backslash in each not two.

    • #75566
      Anonymous
      Inactive

      (\u+)+\K\u+

    • #75568
      Masood Ahmad
      Participant

      So, in the above example, where do you exactly wants to insert the line-break?

    • #75573
      Luis Mira
      Member

      Eugene, it worked. Thanks!

      Masood, the line break is at the end of the all caps.

      Thank you both for your help.

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