Is there a quick way to remove the main text from multiple documents?

I completely understand the design decision as to why editing multiple documents in a Scrivenings view doesn’t allow deletion or overwriting across file boundaries – but is there some trick that will actually allow me to do this in another way? I have imported a bunch of files with text that has ended up in the main text that I want to clear out. Other than going through them one-by-one or merging them (which I don’t want to do because I need to retain them as individual documents with separate titles), I can’t figure out a way to do this en masse.

Does anyone know of a technique that would do the job?

Thanks in advance.

You can use Project Replace for this, but you’ll want to ensure you have a project backup first since the action can’t be undone and you don’t want to accidentally wipe out all your stuff… :slight_smile:

  1. In the binder, select the documents you want to clear.
  2. In Edit > Find > Project Replace, type [\S\s]* in the Replace field and leave the With field empty.
    Choose “Regular Expressions (RegEx)” from the pop-up menu.
    Tick “Selected Documents Only” for the Scope.
    Tick only “Text” in the Affects list; everything else there should be left empty unless you also want to entirely clear it.
  3. Click the Replace button.

That should do it! (The RegEx translates to all whitespace characters (\s) and all non-whitespace characters (\S); the asterisk groups it together so rather than replacing individual characters, it gets everything in the document together and replaces it in a single go, which makes the replacement much faster.)

Fantastic – just what I need. Many thanks. (I’ve been meaning to come to grips with RegEx, but my brain shuts down when I try. It would never have occurred to me to use it.)