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

Need help with GREP codes to find/delete text between different text fields

Return to Member Forum

  • Author
    Posts
    • #99989
      Larry Pitts
      Member

      I have created a set of GREP codes that I used XString to run together for Horoscope listings. I have the codes change the font, text size, and do several other formats all in one swoop.
      Plus, I have it delete the shirt-tail at the bottom of the listings where it has the YOU BORN TODAY line and celebrity birthdays, etc.

      Anyway, I’m having trouble deleting the beginning of the text.
      Here is what’s at the beginning.
      FROM KING FEATURES SYNDICATE, 300 W 57th STREET, 41st FLOOR, NEW YORK, NY 10019
      CUSTOMER SERVICE: (800) 708-7311 EXT. 236
      YOUR INDIVIDUAL HOROSCOPE
      FOR RELEASE FRIDAY, DEC. 1, 2017
      BY FRANCIS DRAKE

      What kind of day will tomorrow be? To find out what the stars say, read the forecast given for your birth sign.
      For Saturday, Dec. 2, 2017

      Thanks for any help or advice…..

    • #99990
      Aaron Troia
      Participant

      Hey Larry,

      One way to do it with the text you provided would be to try:

      Find: FROM (?s:.+?)For Saturday, Dec. 2, 2017

      and just leave the replace field empty. The (?s) in (?s:.+?) allows for GREP to do a multiline search.

      Aaron

    • #99991
      Larry Pitts
      Member

      Wow…that’s works…but one problem….I didn’t point this out at the beginning. Sorry. The date changes from day-to-day….is there a wildcard description I can use to zero in on the days and dates….Saturday, Sunday, Monday, etc. with different dates.
      I hope this helps clear up my earlier mistake.
      But this is great. Thanks so much for your help.
      I’ve been banging my head against the wall trying to figure this out.

    • #99992
      Aaron Troia
      Participant

      oh ok, no problem, we can work that in, try something like:

      Find: FROM (?s:.+?)For \w+, \w+\.? \d+, \d+$

      thats a little greedy on the words and numbers but this might be more specific with a few less greedy modifications:

      Find FROM (?s:.+?)For \w+day, \w{3,4}\.? \d{1,2}, \d{4}$

      \w+day will find the days of the week
      \w{3,4}\.? will find your abbreviated months, and just to be sure with months like June, I made it go to four letters and the decimal is optional
      \d{1,2} is your days of the month
      \d{4} is your year

    • #99993
      Larry Pitts
      Member

      Got it…Fantastic, Aaron….Thanks so much. You’re the master….I’ve seen a lot of your post here and I’ve learned a lot from just reading your replies….Thanks again…made my day….

    • #99999
      Aaron Troia
      Participant

      No problem Larry, I just updated both RegEx’s from that last post to account for months like June that might not be abbreviated and so not necessarily need the period.

    • #100000
      Aaron Troia
      Participant

      And thank you Larry, you’re too kind, and I’m glad to hear I made your day :) I really do enjoy helping with GREP questions and try to help as much as I can, when I can, in the forum :)

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