@echo off
setlocal enabledelayedexpansion
D:
cd D:\DIYHome2.1Autotesting\TestingReports
(for /f "tokens=*� delims=- " %%a in ('find /c "��璇�:" *.log') do (
echo %%a
)) >>ErrorCounts.txt
===================================
璇�缁�:
@echo off
setlocal enabledelayedexpansion
D:
cd D:\DIYHome2.1Autotesting\TestingReports
for /f "tokens=1,* delims==" %%a in (Logout.sikuli.log) do (
echo "%%a"|findstr "��璇�:" &&echo %%a >>ErrorDetails.txt
)
==================================================
����寰���:
@echo off
setlocal enabledelayedexpansion
D:
cd D:\Autotesting\DIYHome2.1Autotesting\TestingReports
(
for %%f in (*.log) do (
for /f "tokens=1,* delims==" %%a in (%%~sf) do (
echo "%%a"|findstr "��璇�:" &&echo %%a >>ErrorDetails.txt
)
)
)
==================================================
@echo off
setlocal enabledelayedexpansion
D:
cd D:\DIYHome2.1Autotesting\TestingReports
(echo aCode = "UTF-8"
echo bCode = "GB2312"
echo Set objArgs = WScript.Arguments
echo.
echo FileUrlSrc = objArgs^(0^)
echo FileUrlDst = objArgs^(1^)
echo Call WriteToFile^(FileUrlDst, ReadFile^(FileUrlSrc, aCode^), bCode^)
echo.
echo Function ReadFile^(FileUrlSrc, CharSet^)
echo� � Dim Str
echo� � Set stm = CreateObject^("Adodb.Stream"^)
echo� � stm.Type = 2
echo� � stm.mode = 3
echo� � stm.charset = CharSet
echo� � stm.Open
echo� � stm.loadfromfile FileUrlSrc
echo� � Str = stm.readtext
echo� � stm.Close
echo� � Set stm = Nothing
echo� � ReadFile = Str
echo End Function
echo.
echo Function WriteToFile ^(FileUrlDst, Str, CharSet^)
echo� � Set stm = CreateObject^("Adodb.Stream"^)
echo� � stm.Type = 2
echo� � stm.mode = 3
echo� � stm.charset = CharSet
echo� � stm.Open
echo� � stm.WriteText Str
echo� � stm.SaveToFile FileUrlDst, 2
echo� � stm.flush
echo� � stm.Close
echo� � Set stm = Nothing
echo End Function)>U82ANI.vbs
for /r %%a in (*.log) do (
U82ANI.vbs "%%~a" "%%~a.ansi"
move /y "%%~a.ansi" "%%~a">nul
)
del U82ANI.vbs
=======================================