![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-23 17:20 |
47,812 topics / 349,917 posts / today 0 new / 48,274 members |
| DOS批处理 & 脚本技术(批处理室) » Problems with batch string operations and replacements |
| Printable Version 1,708 / 4 |
| Floor1 autoit | Posted 2006-04-06 06:45 |
| 系统支持 Posts 339 Credits 904 From 厦门 | |
|
Recently encountered a problem. The version above V6.0 of "All-in-one String Batch Replace" couldn't achieve it, so I thought about using batch processing. But it didn't work out... I post it to ask the moderators and those who know, thanks in advance.
Replace all , , , .... in the following text with , , , ,....., that is, the numbers in the square brackets are uniformly added by a certain number. Processed with batch processing into: Everyone give a method or discuss it. |
|
| Floor2 chenhui530 | Posted 2006-04-06 10:33 |
| 高级用户 Posts 273 Credits 772 | |
|
Just use change.
|
|
| Floor3 chenall | Posted 2006-04-06 18:39 |
| 银牌会员 Posts 469 Credits 1,276 From 福建泉州 | |
|
Replace a.txt with the original file and replace B.txt with the finally generated file. I wonder if it can meet your requirements. This cannot handle blank lines, that is, all blank lines will be deleted after running.
|
|
| Floor4 无奈何 | Posted 2006-04-06 21:44 |
| 荣誉版主 Posts 356 Credits 1,338 | |
|
If you are willing to try, use AWK to have a go.
AWK download address: http://www.cs.bell-labs.com/cm/cs/who/bwk/awk95.exe |
|
| Floor5 autoit | Posted 2006-04-07 00:29 |
| 系统支持 Posts 339 Credits 904 From 厦门 | |
|
Thanks to the help of the above几位 brothers, the method I finally used is the AWK method provided by "Wu Nai He".
Just added " >test1.txt" later to output again. Although this change was not used this time, I am still very grateful. Thank you. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |