fr为第三方命令,下载地址:http://ishare.iask.sina.com.cn/f/7088512.html
被处理文件为:1.xml
- @echo off&setlocal enabledelayedexpansion
- copy 1.xml Xing.txt>nul
- fr Xing.txt /ric:"\" " /t:"\"\r\n"
- fr Xing.txt /ric:">" /t:">\r\n"
- (for /f "tokens=1* delims==" %%a in (Xing.txt) do (
- set Han=%%b
- set Han=!Han:~1,-1!
- if /i "%%a"=="boardType" set Ye1=!Han!
- if /i "%%a"=="<ns1:BoardXML serialNumber" set Ye2=!Han:~0,-2!
- if /i "%%a"=="<ns1:BoardTestXMLExport testTime" set Ye0=!Han!
- if /i "%%a"=="<ns1:StationXML testerName" (
- set Ye3=!Ye0:~-5!:00 !Ye0:~5,2!/!Ye0:~8,2!/!Ye0:~0,4!
- set Ye7=!Ye2!!Ye0:~0,4!!Ye0:~5,2!!Ye0:~8,2!!Ye0:~-5,2!!Ye0:~-2!00
- )
- if /i "%%a"=="<ns1:TestXML name" set Gu=!Han!
- if defined Gu (
- if /i "%%a"=="repairStatus" set Ye4=!Han!
- if /i "%%a"=="<ns1:ComponentXML designator" set Ye5=!Han!
- if /i "%%a"=="indictmentType" set Ye6=!Han!
- )
- if /i "%%a"=="</ns1:TestXML>" if /i "!Ye4!"=="False Call" (echo !Ye1! !Ye2! !Ye3! fail !Ye5! !Ye6!) else echo !Ye1! !Ye2! !Ye3! pass
- )
- )>Gu.txt
- del /q Xing.txt
- ren Gu.txt %Ye7%.txt
复制代码
[ 本帖最后由 hanyeguxing 于 2010-12-12 19:34 编辑 ] |