如何复制每行11次,将每行的最后一个“ 1”从2-12递增
我在文件中有很多行,我想将每行复制11次(将每行变成12行),并增加每行的最后一个“ 1”,以使12行从“ 1”到“ 12”,最初是“ 1”。每行中可能还会有其他出现的“ 1”,但是我要增加的“ 1”将始终是每行中的最后一个出现。另一种看待它的方法是最后一个“ 1”总是在“ / nt /”之后-像在“ / nt / 1”中一样(并且它始终是每行中唯一出现的“ / nt / 1”) 。 因此,例如,如果我有: 1stlineblahblahblah/nt/1blah 2ndlineblahblahblah/nt/1blah 3rdlineblahblahblah/nt/1blah 我想把它变成: 1stlineblahblahblah/nt/1blah 1stlineblahblahblah/nt/2blah 1stlineblahblahblah/nt/3blah 1stlineblahblahblah/nt/4blah 1stlineblahblahblah/nt/5blah 1stlineblahblahblah/nt/6blah 1stlineblahblahblah/nt/7blah 1stlineblahblahblah/nt/8blah 1stlineblahblahblah/nt/9blah 1stlineblahblahblah/nt/10blah 1stlineblahblahblah/nt/11blah 1stlineblahblahblah/nt/12blah 2ndlineblahblahblah/nt/1blah 2ndlineblahblahblah/nt/2blah 2ndlineblahblahblah/nt/3blah ... 我以前找到了命令: :for i in range(0,12) | put ='1stlineblahblahblah/nt/'.i.'blah' | …