Alexander_88
24-11-2015, 23:25
Здравствуйте, подскажите, пожалуйста, как можно сделать замену ссылок в txt файле? Заменять нужно по именам файлов (после последней косой черты). новые ссылки находятся в отдельном txt файле.
Файл в котором нужно сделать замену imagelink.txt
http://s7.depic.me/034341/r4dfsdfjfat9_o/0005swl_t.jpg
http://s7.depic.me/01421/o7thshjlpdom_o/0006swl_m.jpg
http://s7.depic.me/01421/ooljfhd5ub1_o/0006swl_t.jpg
http://s6.depic.me/01341/73ahjhj0cw18_o/0007swl_m.jpg
http://s5.depic.me/01341/c5ayuyu9ici_o/0007swl_t.jpg
http://s7.depic.me/01445/lw1jkhgzenx_o/0008swl_m.jpg
http://s7.depic.me/01445/jav5cbvxn78b_o/0008swl_t.jpg
http://s6.depic.me/01341/qq57sfdfgbbm_o/0009swl_m.jpg
Файл, в котором находятся новые ссылки: new.txt
http://s6.depic.me/01341/73aaaaaaa0cw18_o/0007swl_m.jpg
http://s7.depic.me/01421/ooljfbbbbbbbhd5ub1_o/0006swl_t.jpg
Результат после выполнения, imagelink.txt стал таким:
http://s7.depic.me/034341/r4dfsdfjfat9_o/0005swl_t.jpg
http://s7.depic.me/01421/o7thshjlpdom_o/0006swl_m.jpg
http://s7.depic.me/01421/ooljfbbbbbbbhd5ub1_o/0006swl_t.jpg
http://s6.depic.me/01341/73aaaaaaa0cw18_o/0007swl_m.jpg
http://s5.depic.me/01341/c5ayuyu9ici_o/0007swl_t.jpg
http://s7.depic.me/01445/lw1jkhgzenx_o/0008swl_m.jpg
http://s7.depic.me/01445/jav5cbvxn78b_o/0008swl_t.jpg
http://s6.depic.me/01341/qq57sfdfgbbm_o/0009swl_m.jpg
Файл в котором нужно сделать замену imagelink.txt
http://s7.depic.me/034341/r4dfsdfjfat9_o/0005swl_t.jpg
http://s7.depic.me/01421/o7thshjlpdom_o/0006swl_m.jpg
http://s7.depic.me/01421/ooljfhd5ub1_o/0006swl_t.jpg
http://s6.depic.me/01341/73ahjhj0cw18_o/0007swl_m.jpg
http://s5.depic.me/01341/c5ayuyu9ici_o/0007swl_t.jpg
http://s7.depic.me/01445/lw1jkhgzenx_o/0008swl_m.jpg
http://s7.depic.me/01445/jav5cbvxn78b_o/0008swl_t.jpg
http://s6.depic.me/01341/qq57sfdfgbbm_o/0009swl_m.jpg
Файл, в котором находятся новые ссылки: new.txt
http://s6.depic.me/01341/73aaaaaaa0cw18_o/0007swl_m.jpg
http://s7.depic.me/01421/ooljfbbbbbbbhd5ub1_o/0006swl_t.jpg
Результат после выполнения, imagelink.txt стал таким:
http://s7.depic.me/034341/r4dfsdfjfat9_o/0005swl_t.jpg
http://s7.depic.me/01421/o7thshjlpdom_o/0006swl_m.jpg
http://s7.depic.me/01421/ooljfbbbbbbbhd5ub1_o/0006swl_t.jpg
http://s6.depic.me/01341/73aaaaaaa0cw18_o/0007swl_m.jpg
http://s5.depic.me/01341/c5ayuyu9ici_o/0007swl_t.jpg
http://s7.depic.me/01445/lw1jkhgzenx_o/0008swl_m.jpg
http://s7.depic.me/01445/jav5cbvxn78b_o/0008swl_t.jpg
http://s6.depic.me/01341/qq57sfdfgbbm_o/0009swl_m.jpg