Find & replace w/ nothing/delete

Found a post about this with no responses:

Is it possible to use find and replace to delete certain strings instead of replacing them?

I’m copying quotes out of a PDF and often end up with words that were wrapped/hyphenated in the original, e.g. “I shall gen- eralize, and …”. I’d like to use find and replace to take the hyphen and space out; is this possible in Scrivener, or is there a better way of going about this in general?

I think you should be able to accomplish this by leaving the replace field blank in Edit/Find/Project Replace. Beware, though, since it is not possible to undo this command. For more info I suggest you to read through the 21.1.3 Project Replace section of the manual.

Hope this helps!

Ah, worked great, thanks. Hadn’t even thought to look there, as I only wanted to replace in one document. Bit scary to use, though. :stuck_out_tongue:

If just in one doc, search and replace will work fine within that doc.

Search for whatever you want, but leave the replace blank.

If in doubt, duplicate (or snapshot) the doc before you start so that you have a backup copy to rely on.

As Briar said, if it’s specific to a single document, you can use Edit > Find > Find… to do the find replace on just the loaded text. Project Replace also has an option to narrow the scope to only the selected document, so you could select the one or more documents in the binder, then run the project replace with that option selected.

This isn’t working for me with the Edit > Find > Find… command. Leaving the replace field blank results in nothing happening when I press replace. I just tried once again, trying to turn “gen- eralize” into “generalize”, the Find command finds the hyphen-space string "- " with no issues, but clicking on replace doesn’t do anything. What am I missing?

Edit: Okay, that’s odd. Just messed around a bit more, and clicking on Replace All does work, while Replace and Replace & Find do not.