[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. hash /printf:"%d-%s",number,string /file 11.txt >22.txt
复制代码

TOP

  1. @echo off
  2. (for /f "tokens=1* delims=:" %%a in ('findstr /n .* 11.txt') do echo %%a-%%b)>22.txt
复制代码
1

评分人数

    • wh1234567: 热心助人,感谢您的帮助技术 + 1

TOP

本帖最后由 CrLf 于 2014-7-21 00:22 编辑
  1. @echo off
  2. for /f %%a in ('find /c /v "" ^<11.txt') do set count=%%a
  3. (for /l %%a in (1 1 %count%) do (
  4.   setlocal enabledelayedexpansion
  5.   set /p "str="&echo;%%a-!str!
  6.   endlocal
  7. ))<11.txt >22.txt
复制代码

TOP

  1. @echo off
  2. ((for /f "delims=" %%a in ('findstr /n .* 11.txt') do (
  3.    set "str=%%a"
  4.    set /a n+=1
  5.    setlocal enabledelayedexpansion
  6.    set "str=!str:*:=!"
  7.    echo !n!-!str!
  8.    endlocal
  9. ))>22.txt
复制代码

TOP

  1. @set @a=0;/*&echo off
  2. findstr /n .* 11.txt |cscript /nologo /e:jscript %0 >22.txt
  3. pause&exit
  4. */
  5. str = WScript.StdIn.ReadAll()
  6. str = str.replace(/^(\d+):/gm,'$1-')
  7. WScript.Echo(str)
复制代码

TOP

  1. @set @a=0;/*&echo off
  2. cscript /nologo /e:jscript %0 <11.txt >22.txt
  3. pause&exit
  4. */
  5. str = WScript.StdIn.ReadAll()
  6. str = str.replace(/\r?\n/g,'");WScript.Echo(++i + "-')
  7. str = 'WScript.Echo((i=1)+"-'+str+'")'
  8. eval(str)
复制代码

TOP

回复 14# wh1234567


    我这测试没问题

TOP

返回列表