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

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

  • 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 '18 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. – usr2564301 Oct 22 '18 at 18:04
  • (Minor #2 😊) You can lop off the spaces at the end by moving the final \s outside the closing parenthesis. – usr2564301 Oct 22 '18 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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