查找/替换但增量值 [英] Find/Replace but Increment Value

查看:107
本文介绍了查找/替换但增量值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.HTML文件,它附有许多照片以显示照片库。我正在用新的照片取代旧照片,我认为必须有一种比复制和粘贴重复文件名更加智能的方式。



我希望能够在每个替换项上替换并增加一个文件名,从我选择的基本文件名开始。例如...

  ... images / 69thStreet010.jpg 
... images / 69thStreet011.jpg
... images / 69thStreet012.jpg

基本上执行CTRL + F和REPLACE'69thStreet010 .jpg'with ...

  ... images / xyz001.jpg 
... images / xyz002。 jpg
... images / xyz003.jpg

等等直到我想要停止。这里有人有什么建议吗?非常感谢!



更新:我还应该补充一点,我使用Notepad ++来编辑我的文件。

解决方案

查看 Column Editor 功能。你可以在你想增加的区域做一个区块选择,然后给它一个开始/结束范围,并且你全都设定了。

我处于类似的情况最近。我做了一些正则表达式搜索/替换,以使我的文件名变成我的默认格式,其中有一些填充了000的地方,我希望我的增量开始。之后,我使用 Shift + ALT 来阻止选择000s,并使用编辑器完成剩下的工作。


I have an .HTML file that has many photos attached to it for displaying a photo gallery. I'm replacing old photos with new ones, and I'm thinking there must be a more intelligent way than simply copying and pasting repetitive file names.

I would love to be able to replace and increment a file name on each replace, starting at a base file name of my choosing. For example...

...images/69thStreet010.jpg
...images/69thStreet011.jpg
...images/69thStreet012.jpg

Basically performing a CTRL+F and REPLACE '69thStreet010.jpg' with...

...images/xyz001.jpg
...images/xyz002.jpg
...images/xyz003.jpg

And so on until I want it to stop. Anyone here have any suggestions? Thanks a lot!

UPDATE: I should also add, I'm using Notepad++ to edit my files.

解决方案

Look into the Column Editor feature within Notepad++. You can do a block select on the area you want to increment and then give it a starting/ending range and you're all set.

I was in a similar situation recently. I did a little bit of regular expression search/replace to get my filenames into my "default" format with some padded "000" where I wanted my incrementing to start. After that I used Shift+ALT to block select the 000s and used the editor to do the rest of the work.

这篇关于查找/替换但增量值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆