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 to move words from back to front of line

Return to Forums

  • Author
    Posts
    • #65345
      Anonymous
      Inactive

      Hi, I’m working on an index list a client has supplied. There are loads of instances where an entry is given like this: ‘Aaron, Joseph’ (without the “‘”s).

      To be able to use Peter Kahrel’s Index Direct script, I need to move the first name (or in some cases names) from after to in front of the last/family name and delete the comma.

      I’ve had a play around with GREP and worked out how to select the comma, space and first name(s), but for the life of me I can’t figure out how to move their position. (Regarding the ‘obsolete’ comma, I could run a new search and change afterwards to delete all those if there are no other options.)

      Can anyone help me with this? Is it even possible to move things the way I have described?

    • #65347
      David Blatner
      Keymaster

      Yup, you need to put the pieces in parentheses, and then use $2 $1 in the change to field to “turn them around.”
      I know that’s cryptic, sorry, but there’s much more info if you look at: https://creativepro.com/grep

    • #65356
      Anonymous
      Inactive

      Thanks for the reply, David.

      Yes, it’s cryptic, but I’ll follow your link and see what I can come up with.

    • #65786
      Anonymous
      Inactive

      I posted a detailed answer, but it didn’t appear… try searching Cari Jansen’s website – there are examples of grep for this same problem

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
Forum Ads