[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
删除开头的深圳市,就这样?
提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

回复 3# luogu

删除开头的深圳市,第一个区字后面插入逗号,这样?
提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

  1. <# :
  2. cls
  3. @echo off
  4. set info=互助互利,支付宝扫码头像,感谢赞助
  5. rem 有问题,可加QQ956535081及时沟通
  6. title %info%
  7. set "rootpath=%~dp0"
  8. if "%rootpath:~-1%" equ "\" (set "rootpath=%rootpath:~,-1%")
  9. cd /d "%rootpath%"
  10. powershell -NoProfile -ExecutionPolicy bypass "Invoke-Command -ScriptBlock ([ScriptBlock]::Create([IO.File]::ReadAllText('%~f0',[Text.Encoding]::Default))) -Args '%rootpath%'"
  11. echo;%info%
  12. pause
  13. exit
  14. #>
  15. $txtfile='.\xx.txt';
  16. $list='
  17. 深圳市南山区|南山区,
  18. 深圳市宝安区|宝安区,
  19. 深圳市福田区|福田区,
  20. 深圳市龙岗区|龙岗区,
  21. ';
  22. $txtfile=$txtfile -replace '^\.',$args[0];
  23. $arr=$list.trim() -split '[\r\n]+';
  24. $enc=[Text.Encoding]::Default;
  25. $text=[IO.File]::ReadAllText($txtfile,$enc);
  26. for($j=0;$j -lt $arr.length;$j++){
  27.     $brr=$arr[$j].split('|',2);
  28.     $text=$text.replace($brr[0],$brr[1]);
  29. };
  30. [IO.File]::WriteAllText($txtfile, $text, $enc);
复制代码
提供bat代写,为你省时省力省事,支付宝扫码头像支付
微信: unique2random

TOP

返回列表