本帖最后由 yiwuyun 于 2015-1-23 22:15 编辑
- @echo off
- setlocal EnableDelayedExpansion
-
- for /f "delims=" %%i in ('dir /b d:\数据1\*.txt') do (
- set /a j=1
- for /f "delims=" %%a in ('type %%i') do (
- set /a i=1
- for %%b in (%%a) do (
- set A!j!.!i!=%%b
- set /a i+=1
- )
- set /a j+=1
- )
- set /a i-=1
- (for /l %%a in (1,1,!i!) do (
- if "!A1.%%a!" lss "!A2.%%a!" (
- echo !A1.%%a! !A2.%%a!
- )else if "!A1.%%a!"=="!A2.%%a!" (
- rem echo !A2.%%a! !A1.%%a!
- )else (
- echo !A2.%%a! !A1.%%a!
- )
- ))>d:\数据2\%%~ni.txt
- )
- pause
复制代码
- 1>1/* : [url]www.bathome.net[/url]
- @echo off
- for %%a in ("D:\数据1\*.txt") do (
- cscript -nologo -e:jscript "%~0"<"%%a" >"D:\数据2\%%~nxa"
- )
- pause & exit /b */
-
- var a = WSH.StdIn.ReadLine().split(/ /)
- var b = WSH.StdIn.ReadLine().split(/ /)
- var c = []
-
- for(var i=0;i<a.length;i++){
- if(a[i]!=b[i]){
- c.push([a[i],b[i]].sort().join(' '))
- }
- }
-
- WSH.Echo(c.join('\r\n'))
复制代码 好像应该是这样的。 |