1

I am looking to insert a line break after two words for a large document on multiple paragraphs. I am using find/change to search for ^w which inserts a line break after one space, what would be the syntax to search for 2 spaces.

So I need the first two words of a paragraph with a forced line break inserted after those 2 words.

For example: Dan Brown (line break) Author, Fortress, Da Vinci Code etc.

Thanks in advance

Kev

0

1 Answer 1

1

Use this Grep query, which can probably be improved and explained if needed. If you're reusing this multiple times, I suggest saving this query - see the floppy disk icon thing.

enter image description here

3
  • That's fantastic thanks. The only thing is when I replace with suggested GREP it starts a new paragraph instead of just inserting a line break.
    – Kevin
    Oct 22, 2018 at 15:09
  • (Minor only:) while \w matches a word character, which apparently works for the OP, you could also use the not-a-space set \S. That way, you catch everything else that may pop up in a name as well -- think hyphens, apostrophes, the like.
    – Jongware
    Oct 22, 2018 at 18:04
  • (Minor #2 😊) You can lop off the spaces at the end by moving the final \s outside the closing parenthesis.
    – Jongware
    Oct 22, 2018 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.