在 Notepad++ 中移动所有特定文本
Moving all certain texts in Notepad++
我想知道如何将所有 > CONTEXT :
行移动到 > BEGIN STRING
下面
> BEGIN STRING
> CONTEXT: Actors/2/nickname/
Thunderclap of Guren
> END STRING
> BEGIN STRING
> CONTEXT: Actors/3/name/
Terence
> END STRING
> BEGIN STRING
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> CONTEXT: Actors/3/description/
> END STRING
我无法逐行向上移动,因为这将花费很长时间,因为我有大量的文本,就像上面一样,我想全部修复。
编辑:这就是我想要的:
之前:
> BEGIN STRING
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> CONTEXT: Actors/3/description/
> END STRING
之后:
> BEGIN STRING
> CONTEXT: Actors/3/description/
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> END STRING
您无法轻易做到这一点,因为文本不是规则的模式。但这可以通过 notepadd++ 或 sublime 或 anytext editor 来实现,我喜欢在将它们转换为 csv 后使用数字或 excel 来移动列。我建议使用 excel 或 nubmers(mac) 来编辑 csv(在将文本文件转换为 csv 之后)。以下是您可能需要调整以获得结果的内容。
- 首先,我会将文本转换为 csv 格式,方法是在 > 开始字符串之后、>上下文之前、> 上下文行结束之后、> 结束字符串之前添加逗号
您可以通过在 sublime 中选择相似文本 (cmd+d) 并将光标轻松移动到行尾和行首来实现此目的,或者您可以在任何文本编辑器中使用查找和替换功能并尽可能添加逗号使它们在 excel 中打开时显示为不同的列。
- 将逗号添加到文本文件后,将其另存为 csv 并在 excel 中打开。
- 然后将列 >Context(第 3 列)拖到 Begin strings 之后(将其放在第 2 列)并再次保存。
- 再次在文本编辑器中打开您在 excel 中编辑过的 csv 文件,重新格式化并查找并替换以删除逗号。
希望这会有所帮助。
尝试以下方法:
^> BEGIN STRING(\r?\n)+(?!^> CONTEXT:)\K([\s\S]*?)(> CONTEXT:[^\r\n]*)((?:\r?\n)+)?\r?\n
替换为:
我想知道如何将所有 > CONTEXT :
行移动到 > BEGIN STRING
> BEGIN STRING
> CONTEXT: Actors/2/nickname/
Thunderclap of Guren
> END STRING
> BEGIN STRING
> CONTEXT: Actors/3/name/
Terence
> END STRING
> BEGIN STRING
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> CONTEXT: Actors/3/description/
> END STRING
我无法逐行向上移动,因为这将花费很长时间,因为我有大量的文本,就像上面一样,我想全部修复。
编辑:这就是我想要的:
之前:
> BEGIN STRING
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> CONTEXT: Actors/3/description/
> END STRING
之后:
> BEGIN STRING
> CONTEXT: Actors/3/description/
St. knight that has been stripped of his position by the conspiracy. In order to master the true chivalry
It has repeatedly wander training the country.
> END STRING
您无法轻易做到这一点,因为文本不是规则的模式。但这可以通过 notepadd++ 或 sublime 或 anytext editor 来实现,我喜欢在将它们转换为 csv 后使用数字或 excel 来移动列。我建议使用 excel 或 nubmers(mac) 来编辑 csv(在将文本文件转换为 csv 之后)。以下是您可能需要调整以获得结果的内容。
- 首先,我会将文本转换为 csv 格式,方法是在 > 开始字符串之后、>上下文之前、> 上下文行结束之后、> 结束字符串之前添加逗号
您可以通过在 sublime 中选择相似文本 (cmd+d) 并将光标轻松移动到行尾和行首来实现此目的,或者您可以在任何文本编辑器中使用查找和替换功能并尽可能添加逗号使它们在 excel 中打开时显示为不同的列。
- 将逗号添加到文本文件后,将其另存为 csv 并在 excel 中打开。
- 然后将列 >Context(第 3 列)拖到 Begin strings 之后(将其放在第 2 列)并再次保存。
- 再次在文本编辑器中打开您在 excel 中编辑过的 csv 文件,重新格式化并查找并替换以删除逗号。
希望这会有所帮助。
尝试以下方法:
^> BEGIN STRING(\r?\n)+(?!^> CONTEXT:)\K([\s\S]*?)(> CONTEXT:[^\r\n]*)((?:\r?\n)+)?\r?\n
替换为: