Text 修改大写字母并将数字添加到大量文本行中
假设我有成百上千行这样的文本:Text 修改大写字母并将数字添加到大量文本行中,text,notepad++,text-editor,editing,modifier,Text,Notepad++,Text Editor,Editing,Modifier,假设我有成百上千行这样的文本: yes:nice up:true six:hello nine:mouse twenty:cat 我希望它能够做到这一点: yes:Nice1 up:True1 six:Hello1 nine:Mouse1 twenty:Cat1 yes:Nice1 up:True1 six:Hello1 nine:Mouse1 twenty:Cat1 因此,每行都有一个带有文本/数字的边,还有一个冒号(:)用更多的文本/数字分隔另一个边 是否有一种方法可以批量修改每一行,
yes:nice
up:true
six:hello
nine:mouse
twenty:cat
我希望它能够做到这一点:
yes:Nice1
up:True1
six:Hello1
nine:Mouse1
twenty:Cat1
yes:Nice1
up:True1
six:Hello1
nine:Mouse1
twenty:Cat1
因此,每行都有一个带有文本/数字的边,还有一个冒号(:
)用更多的文本/数字分隔另一个边
是否有一种方法可以批量修改每一行,使起始字符位于冒号(:
)大写之后
我还想知道如何在每一行的末尾添加任何数字
基本上,我想知道如何更改冒号后字符的大写,以及如何在结尾添加任何数字 以下是一种完成此项工作的方法:
- Ctrl+H
- 查找内容:
^([^:::+:)(.)(.*)$
- 替换为:
$1\U$2\E${3}1
- 全部替换
^ : begining of line
([^:]+:) : group 1, every thing before the colon & the colon
(.) : group 2, 1 character
(.*) : group 3, every thing after the first character
$
$1 : group 1
\U$2\E : group 2, uppercase
${3} : group 3
1 : the digit 1, or anything you want to append.
更换:
^ : begining of line
([^:]+:) : group 1, every thing before the colon & the colon
(.) : group 2, 1 character
(.*) : group 3, every thing after the first character
$
$1 : group 1
\U$2\E : group 2, uppercase
${3} : group 3
1 : the digit 1, or anything you want to append.
给定示例的结果:
^ : begining of line
([^:]+:) : group 1, every thing before the colon & the colon
(.) : group 2, 1 character
(.*) : group 3, every thing after the first character
$
$1 : group 1
\U$2\E : group 2, uppercase
${3} : group 3
1 : the digit 1, or anything you want to append.
以下是完成此项工作的方法:
- Ctrl+H
- 查找内容:
^([^:::+:)(.)(.*)$
- 替换为:
$1\U$2\E${3}1
- 全部替换
^ : begining of line
([^:]+:) : group 1, every thing before the colon & the colon
(.) : group 2, 1 character
(.*) : group 3, every thing after the first character
$
$1 : group 1
\U$2\E : group 2, uppercase
${3} : group 3
1 : the digit 1, or anything you want to append.
更换:
^ : begining of line
([^:]+:) : group 1, every thing before the colon & the colon
(.) : group 2, 1 character
(.*) : group 3, every thing after the first character
$
$1 : group 1
\U$2\E : group 2, uppercase
${3} : group 3
1 : the digit 1, or anything you want to append.
给定示例的结果:
^ : begining of line
([^:]+:) : group 1, every thing before the colon & the colon
(.) : group 2, 1 character
(.*) : group 3, every thing after the first character
$
$1 : group 1
\U$2\E : group 2, uppercase
${3} : group 3
1 : the digit 1, or anything you want to append.