How to search Footnotes ONLY for repeating text-pattern

Hello all,

I managed to sort this out before, in several of my chapters - but for the life of me, cannot remember what I did.
I can remember that I was quite chuffed at coming up with whatever it was, since it had saved me many hours of time.

[I know it involved a KM macro that I simply cycled through [that moved the cursor around, and did the deleting] - but I am stuck on remembering what search function I must have used to identify the text-patterns being sought…]

Hopefully, someone here can point me to an obvious/simple solution!

Many moons ago, when importing from Word >> RTF >> Scrivener, I was left with inline footnotes that all had a leading [[space]] immediately preceding the footnote text.
(Presumably, this was the leftover remnants of the Footnote number, when still in Word??)

I therefore want to be able to search for all those instances where ONLY a footnote starts with a leading space.
Presumably, a REGEX string will be of use - but is it possible to confine it to only look in footnote text [so as to avoid hitting each and every word of the main text, and the other footnote text, that obviously all have leading spaces?]
If so - how would I go about doing that?

As an aside - thinking about the above a bit more, I’m not sure this can be done.
Maybe the time I saved was simply by my using the KM macro to do the cursor movement and deleting for me, and I still manually clicked into every footnote ‘section’, before invoking the macro.
[Ok - I’m pretty sure that is what I did… So I clearly wasn’t that smart at all! :blush: Regardless, if anyone knows of something that could be tried, kindly let me know!]

Many thanks!

The problem is that you want to remove a leading space, but as you say, spaces are common. In something like FileMaker you could this with a function that finds a “first character = space” then replace it with null “”.

The only thing I can find that allows you to search Inline footnotes is within the Find dialogue - ‘Find by formatting’ - where you can Find inline footnotes; if you did this, you could then cycle through them manually (Find Next) deleting initial spaces if you see them.

Maybe someone else knows a better way?

Find by Formatting - thanks - this is what had slipped my mind. I will play around and see what I can come up with!

One thing to consider is that Scrivener strips out spaces from around footnotes when compiling, because it is often nicer to add a space or two within the footnote range than to have the text all jumbled up next to each other:

So if you mean the space is within the footnote range, then it may be no big deal to leave them in. If the extra space is before the footnote range, then yes that would be more difficult, but a KM macro with the Find by Formatting tool would probably be the best way to approach that. As for automating it a bit further, you could try throwing the Edit/Find/Find Next Formatting command in. That way it would act more like the “Replace & Find”.

Another approach would be to use the folder sync feature (if you don’t need the text formatted), which can be set up to use brackets for footnotes in the Import/Export preference pane. It would be a lot easier to use regex to find extraneous space before “{{” than in the GUI.

Appreciate the comprehensive feedback - I will give these a go!