[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 求助批处理怎么自动匹配TXT文件中固定字符?

求助怎么自动匹配一个TXT文件中固定字符之间内容相同并提取一整行插入另一个TXT当中的相同内容的末行
比如我有两个TXT文本,一个内容如下
[ur.l=http://bathome.ne/fs/9JeN8EeE8R80b93269/]点击进入下载-Jones 47 (1).torrent[ur.l]
[ur.l=http://bathome.ne/fs/9J4N9E4EbR70090263/]点击进入下载-Todd (1).torrent[ur.l]
[ur.l=http://bathome.ne/fs/1J1NbE1E9R40b9c266/]点击进入下载- HOTand Justin Matthews (720p).mp4.torrentc (1).torrent[ur.l]
[ur.l=http://bathome.ne/fs/fJNeEE2R09926614c4/]点击进入下载-Jesse (1).torrent[ur.l]
另一个内容是这样的
[U,RL=https://bathome.net/w9ql8n4z2gky/_HOTand_Justin_Matthews__720p_.mp4.torrentc__1_.jpg] [IM。G]https://img200.bathome.net/th/25578/w9ql8n4z2gky.jpg[IM。G][U,RL
[U,RL=https://bathome.net/8tf7sjuofmcw/_HOTand_Justin_Matthews__720p_.mp4.torrentc__2_.jpg][IM。G]https://img200.bathome.net/th/25578/8tf7sjuofmcw.jpg[IM。G][U,RL
[U,RL=https://bathome.net/sribjmyi3qgt/_HOTand_Justin_Matthews__720p_.mp4.torrentc__3_.jpg][IM。G]https://img200.bathome.net/th/25578/sribjmyi3qgt.jpg[IM。G][U,RL
[U,RL=https://bathome.net/1i8vykf5bv3x/_HOTand_Justin_Matthews__720p_.mp4.torrentc__4_.jpg][IM。G]https://img200.bathome.net/th/25578/1i8vykf5bv3x.jpg[IM。G][U,RL
[U,RL=https://bathome.net/2o05tdhpzxow/_HOTand_Justin_Matthews__720p_.mp4.torrentc__5_.jpg][IM。G]https://img200.bathome.net/th/25578/2o05tdhpzxow.jpg[IM。G][U,RL
[U,RL=https://bathome.net/onp7trgng826/Jesse__1_.JPG][IM。G]https://img200.bathome.net/th/25578/onp7trgng826.jpg[IM。G][U,RL
[U,RL=https://bathome.net/eqxpxelckmnp/Jesse__2_.jpg][IM。G]https://img200.bathome.net/th/25578/eqxpxelckmnp.jpg[IM。G][U,RL
[U,RL=https://bathome.net/0twpresz23co/Jesse__3_.JPG][IM。G]https://img200.bathome.net/th/25578/0twpresz23co.jpg[IM。G][U,RL
[U,RL=https://bathome.net/pwvgi2ctip3g/Jesse__4_.jpg][IM。G]https://img200.bathome.net/th/25578/pwvgi2ctip3g.jpg[IM。G][U,RL
[U,RL=https://bathome.net/amdhxf484ogx/Jones_47__1_.jpg][IM。G]https://img200.bathome.net/th/25578/amdhxf484ogx.jpg[IM。G][U,RL
[U,RL=https://bathome.net/bqdeph1ow9yu/Jones_47__2_.jpg][IM。G]https://img200.bathome.net/th/25578/bqdeph1ow9yu.jpg[IM。G][U,RL
[U,RL=https://bathome.net/mgkp502pf28s/Jones_47__3_.jpg][IM。G]https://img200.bathome.net/th/25578/mgkp502pf28s.jpg[IM。G][U,RL
[U,RL=https://bathome.net/libk0gwwg3r6/Jones_47__4_.jpg][IM。G]https://img200.bathome.net/th/25578/libk0gwwg3r6.jpg[IM。G][U,RL
[U,RL=https://bathome.net/a62yt1ji91ry/Todd__1_.jpg][IM。G]https://img200.bathome.net/th/25578/a62yt1ji91ry.jpg[IM。G][U,RL
[U,RL=https://bathome.net/lgjgv11ua0wo/Todd__2_.jpg][IM。G]https://img200.bathome.net/th/25578/lgjgv11ua0wo.jpg[IM。G][U,RL
[U,RL=https://bathome.net/1b6f44su29yg/Todd__3_.jpg][IM。G]https://img200.bathome.net/th/25578/1b6f44su29yg.jpg[IM。G][U,RL
[U,RL=https://bathome.net/zicq6sqhza23/Todd__4_.jpg][IM。G]https://img200.bathome.net/th/25578/zicq6sqhza23.jpg[IM。G][U,RL





我想达到这样的效果把第一个文本的内容和第二个文本自动匹配相同的内容再插入相同内容的最后一行,效果如下:
[U,RL=https://bathome.net/w9ql8n4z2gky/_HOTand_Justin_Matthews__720p_.mp4.torrentc__1_.jpg][IM。G]https://img200.bathome.net/th/25578/w9ql8n4z2gky.jpg[IM。G][U,RL
[U,RL=https://bathome.net/8tf7sjuofmcw/_HOTand_Justin_Matthews__720p_.mp4.torrentc__2_.jpg][IM。G]https://img200.bathome.net/th/25578/8tf7sjuofmcw.jpg[IM。G][U,RL
[U,RL=https://bathome.net/sribjmyi3qgt/_HOTand_Justin_Matthews__720p_.mp4.torrentc__3_.jpg][IM。G]https://img200.bathome.net/th/25578/sribjmyi3qgt.jpg[IM。G][U,RL
[U,RL=https://bathome.net/1i8vykf5bv3x/_HOTand_Justin_Matthews__720p_.mp4.torrentc__4_.jpg][IM。G]https://img200.bathome.net/th/25578/1i8vykf5bv3x.jpg[IM。G][U,RL
[U,RL=https://bathome.net/2o05tdhpzxow/_HOTand_Justin_Matthews__720p_.mp4.torrentc__5_.jpg][IM。G]https://img200.bathome.net/th/25578/2o05tdhpzxow.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/1J1NbE1E9R40b9c266/]点击进入下载- HOTand Justin Matthews (720p).mp4.torrentc (1).torrent[U,RL



[U,RL=https://bathome.net/onp7trgng826/Jesse__1_.JPG][IM。G]https://img200.bathome.net/th/25578/onp7trgng826.jpg[IM。G][U,RL
[U,RL=https://bathome.net/eqxpxelckmnp/Jesse__2_.jpg][IM。G]https://img200.bathome.net/th/25578/eqxpxelckmnp.jpg[IM。G][U,RL
[U,RL=https://bathome.net/0twpresz23co/Jesse__3_.JPG][IM。G]https://img200.bathome.net/th/25578/0twpresz23co.jpg[IM。G][U,RL
[U,RL=https://bathome.net/pwvgi2ctip3g/Jesse__4_.jpg][IM。G]https://img200.bathome.net/th/25578/pwvgi2ctip3g.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/fJNeEE2R09926614c4/]点击进入下载-Jesse (1).torrent[ur.l]



[U,RL=https://bathome.net/amdhxf484ogx/Jones_47__1_.jpg][IM。G]https://img200.bathome.net/th/25578/amdhxf484ogx.jpg[IM。G][U,RL
[U,RL=https://bathome.net/bqdeph1ow9yu/Jones_47__2_.jpg][IM。G]https://img200.bathome.net/th/25578/bqdeph1ow9yu.jpg[IM。G][U,RL
[U,RL=https://bathome.net/mgkp502pf28s/Jones_47__3_.jpg][IM。G]https://img200.bathome.net/th/25578/mgkp502pf28s.jpg[IM。G][U,RL
[U,RL=https://bathome.net/libk0gwwg3r6/Jones_47__4_.jpg][IM。G]https://img200.bathome.net/th/25578/libk0gwwg3r6.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/9JeN8EeE8R80b93269/]点击进入下载-Jones 47 (1).torrent[ur.l]


[U,RL=https://bathome.net/a62yt1ji91ry/Todd__1_.jpg][IM。G]https://img200.bathome.net/th/25578/a62yt1ji91ry.jpg[IM。G][U,RL
[U,RL=https://bathome.net/lgjgv11ua0wo/Todd__2_.jpg][IM。G]https://img200.bathome.net/th/25578/lgjgv11ua0wo.jpg[IM。G][U,RL
[U,RL=https://bathome.net/1b6f44su29yg/Todd__3_.jpg][IM。G]https://img200.bathome.net/th/25578/1b6f44su29yg.jpg[IM。G][U,RL
[U,RL=https://bathome.net/zicq6sqhza23/Todd__4_.jpg][IM。G]https://img200.bathome.net/th/25578/zicq6sqhza23.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/9J4N9E4EbR70090263/]点击进入下载-Todd (1).torrent[ur.l]
请问各位大神要怎么弄这个BAT代码 ,在此先谢谢各位了。如果一个一个的找出来再插入真的太累了。

回复 2# WHY


    请问大您的思路是什么样的

TOP

我按照大大的去做了  怎么没有输出C呢

TOP

回复 6# xczxczxcz


   请问一下大大 如果有特殊符号的话  5,6行要怎么改啊, 不胜感激啊

TOP

回复 6# xczxczxcz


    非常感谢你 我的大大 。能否使输出的文件按分类好的文本自动以匹配好的名字输出并以匹配的字符做为文件名

因为按您的命令分类好是这样:
[U,RL=https://bathome.net/w9ql8n4z2gky/_HOTand_Justin_Matthews__720p_.mp4.torrentc__1_.jpg][IM。G]https://img200.bathome.net/th/25578/w9ql8n4z2gky.jpg[IM。G][U,RL
[U,RL=https://bathome.net/8tf7sjuofmcw/_HOTand_Justin_Matthews__720p_.mp4.torrentc__2_.jpg][IM。G]https://img200.bathome.net/th/25578/8tf7sjuofmcw.jpg[IM。G][U,RL
[U,RL=https://bathome.net/sribjmyi3qgt/_HOTand_Justin_Matthews__720p_.mp4.torrentc__3_.jpg][IM。G]https://img200.bathome.net/th/25578/sribjmyi3qgt.jpg[IM。G][U,RL
[U,RL=https://bathome.net/1i8vykf5bv3x/_HOTand_Justin_Matthews__720p_.mp4.torrentc__4_.jpg][IM。G]https://img200.bathome.net/th/25578/1i8vykf5bv3x.jpg[IM。G][U,RL
[U,RL=https://bathome.net/2o05tdhpzxow/_HOTand_Justin_Matthews__720p_.mp4.torrentc__5_.jpg][IM。G]https://img200.bathome.net/th/25578/2o05tdhpzxow.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/1J1NbE1E9R40b9c266/]点击进入下载- HOTand Justin Matthews (720p).mp4.torrentc (1).torrent[U,RL



[U,RL=https://bathome.net/onp7trgng826/Jesse__1_.JPG][IM。G]https://img200.bathome.net/th/25578/onp7trgng826.jpg[IM。G][U,RL
[U,RL=https://bathome.net/eqxpxelckmnp/Jesse__2_.jpg][IM。G]https://img200.bathome.net/th/25578/eqxpxelckmnp.jpg[IM。G][U,RL
[U,RL=https://bathome.net/0twpresz23co/Jesse__3_.JPG][IM。G]https://img200.bathome.net/th/25578/0twpresz23co.jpg[IM。G][U,RL
[U,RL=https://bathome.net/pwvgi2ctip3g/Jesse__4_.jpg][IM。G]https://img200.bathome.net/th/25578/pwvgi2ctip3g.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/fJNeEE2R09926614c4/]点击进入下载-Jesse (1).torrent[ur.l]



[U,RL=https://bathome.net/amdhxf484ogx/Jones_47__1_.jpg][IM。G]https://img200.bathome.net/th/25578/amdhxf484ogx.jpg[IM。G][U,RL
[U,RL=https://bathome.net/bqdeph1ow9yu/Jones_47__2_.jpg][IM。G]https://img200.bathome.net/th/25578/bqdeph1ow9yu.jpg[IM。G][U,RL
[U,RL=https://bathome.net/mgkp502pf28s/Jones_47__3_.jpg][IM。G]https://img200.bathome.net/th/25578/mgkp502pf28s.jpg[IM。G][U,RL
[U,RL=https://bathome.net/libk0gwwg3r6/Jones_47__4_.jpg][IM。G]https://img200.bathome.net/th/25578/libk0gwwg3r6.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/9JeN8EeE8R80b93269/]点击进入下载-Jones 47 (1).torrent[ur.l]

[U,RL=https://bathome.net/a62yt1ji91ry/Todd__1_.jpg][IM。G]https://img200.bathome.net/th/25578/a62yt1ji91ry.jpg[IM。G][U,RL
[U,RL=https://bathome.net/lgjgv11ua0wo/Todd__2_.jpg][IM。G]https://img200.bathome.net/th/25578/lgjgv11ua0wo.jpg[IM。G][U,RL
[U,RL=https://bathome.net/1b6f44su29yg/Todd__3_.jpg][IM。G]https://img200.bathome.net/th/25578/1b6f44su29yg.jpg[IM。G][U,RL
[U,RL=https://bathome.net/zicq6sqhza23/Todd__4_.jpg][IM。G]https://img200.bathome.net/th/25578/zicq6sqhza23.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/9J4N9E4EbR70090263/]点击进入下载-Todd (1).torrent[ur.l]  

但是我最后想达到这样的效果,就是使分类好的文件分割成同等的单独的份数并以匹配的字符命名文件。

按照样本输出最终是:      HOTand Justin Matthews (720p).mp4.torrentc.txt          Jesse (1).txt       Jones 47 (1).txt       Todd (1).txt      


谢谢大大了

TOP

回复 9# xczxczxcz
大大   我用我发上去的那样测试没问题,可是当换成其它文件的时候就出问题了,输出的文件虽然能按照匹配的字符重命名文件,但是后面没有点TXT直接就没有点,这样要一个一个加入点才能变成扩展的TXT才能打开,并且好多的文本内容没有匹配到 ,是怎么回事,请指教一下,不胜感激,下面这个是出错的文件  工作量太大了 求帮一下 谢谢了

TOP

回复 11# WHY

    不好意思大大,,是我没说清楚,他们的规律就是两个文件中有都会有一部份相同的字符的  把相同的匹配在一起  这就是达到的效果 并以匹配的字符作为文件名输出 得到 HOTand Justin Matthews (720p).mp4.torrentc (1).torrent.txt 之关的文件

[U,RL=https://bathome.net/w9ql8n4z2gky/_HOTand_Justin_Matthews__720p_.mp4.torrentc__1_.jpg][IM。G]https://img200.bathome.net/th/25578/w9ql8n4z2gky.jpg[IM。G][U,RL
[U,RL=https://bathome.net/8tf7sjuofmcw/_HOTand_Justin_Matthews__720p_.mp4.torrentc__2_.jpg][IM。G]https://img200.bathome.net/th/25578/8tf7sjuofmcw.jpg[IM。G][U,RL
[U,RL=https://bathome.net/sribjmyi3qgt/_HOTand_Justin_Matthews__720p_.mp4.torrentc__3_.jpg][IM。G]https://img200.bathome.net/th/25578/sribjmyi3qgt.jpg[IM。G][U,RL
[U,RL=https://bathome.net/1i8vykf5bv3x/_HOTand_Justin_Matthews__720p_.mp4.torrentc__4_.jpg][IM。G]https://img200.bathome.net/th/25578/1i8vykf5bv3x.jpg[IM。G][U,RL
[U,RL=https://bathome.net/2o05tdhpzxow/_HOTand_Justin_Matthews__720p_.mp4.torrentc__5_.jpg][IM。G]https://img200.bathome.net/th/25578/2o05tdhpzxow.jpg[IM。G][U,RL
[ur.l=http://bathome.ne/fs/1J1NbE1E9R40b9c266/]点击进入下载- HOTand Justin Matthews (720p).mp4.torrentc (1).torrent[U,RL

TOP

本帖最后由 GEVENS 于 2018-10-15 21:14 编辑

回复 13# xczxczxcz

已经非常感谢了,你发什么都很感谢了  我真的没有说一半留一半,只是遇到的文件类型不一样,用新文件试了才知道,不过无论如何都非常感谢 我也不会再问一下去 了  谢谢!

TOP

返回列表