我发现自己需要这样做,并创建了一个正则表达式,允许我按书卷将所有的 Status(状态)字段从“todo”(待办)更改为“deleted”(已删除)。我注意到 XML 文件中字段的格式/顺序始终是一致的:

image1284×121 7.28 KB
因此,我能够创建一个表达式,它查找特定书卷中的 VerseRef(经文引用),忽略该行其余部分,然后跳过任何以空格开头后跟 <S 或 <C 的行,接着查找以空格开头后跟 <Status>todo 的行。它会将该“todo”更改为“deleted”。表达式如下:
Find: (VerseRef="\dJN .+\r\n(\s+<[SC].+\r\n)*?\s+<Status>)todo
Replace: \1deleted
因此,在一个支持正则表达式的文本编辑器中(如果没有首选编辑器,可以使用 Notepad++),使用这些查找和替换字符串来查找 1JN、2JN、3JN 中所有未解决的笔记,并将它们更改为已解决。
查找表达式中的 \dJN 使用另一个正则表达式来查找所有以数字开头后跟 JN 的书卷中的笔记。您可以将该字符串替换为另一个书卷代码,以查找该书卷中的笔记,例如 MAT、ISA,或者像 \dCO 这样用于 1CO 和 2CO。
希望这对某个人有帮助(如果我又不得不这样做,可能也会对我有帮助……
)
I found myself needing to do this, and created a Regular Expression that allows me to change all of the Status fields from “todo” to “deleted” on a book by book basis. I noticed that the format/order of the fields in the XML file was always consistent:

image1284×121 7.28 KB
So I was able to create an expression that finds a VerseRef in a particular book, ignores the rest of that line, then skips over any number of lines that begin with spaces and then a <S or <C, then looks for a line that starts with spaces and then <Status>todo. It will change that “todo” to “deleted”. Here is the expression:
Find: (VerseRef="\dJN .+\r\n(\s+<[SC].+\r\n)*?\s+<Status>)todo
Replace: \1deleted
So in a text editor that can work with Regular Expressions (Notepad++ if you don’t have a favorite), use those find and replace strings to find all of the notes that are not resolved in 1JN, 2JN, 3JN, and change them to resolved.
The \dJN in the find expression uses a further RegEx to find notes in all books that start with a digit and then JN. You can replace that string with another book code to find the notes in that book, e.g. MAT, ISA, or things like \dCO for 1CO and 2CO.
Hope that helps someone out there (and might help me if I have to do it again…
)
机器翻译自 English