1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
@echo off & setlocal enabledelayedexpansion & chcp 65001 if not "%username%"=="****" exit call :sound "此工具为****,****专用" call :sound "数据处理中,请稍候……" xdoc2txt -8 "验货未收货细信息导出.xls" > Xls2Txt.txt ::==========转换表格为可读========== cd. >Filter.txt for /f "skip=3 tokens=3-11" %%a in ( Xls2Txt.txt ) do ( if "%%g"=="018" if "%%h"=="*********" echo %%a )>>Filter.txt >nul del /s /q Xls2Txt.txt ::==========过滤路区及地址========== >nul chcp 936 cd. >TempDQ.txt if not exist BuQi.txt ( cd. >BuQi.txt rename Filter.txt Filtered.txt ) else ( cd. >Filtered.txt copy /b BuQi.txt+Filter.txt TempFilter.txt for /f "delims=" %%a in (TempFilter.txt) do ( find /i "%%a" Filtered.txt||echo %%a>>Filtered.txt ) )>nul >nul del /s /q TempFilter.txt ::==========旧数据查重合并========== for /f "tokens=1-4 delims=-" %%a in ( Filtered.txt ) do ( set n=0 rem echo %%a %%b %%c for /f %%A in ('findstr /r "%%a" "Filtered.txt"') do set/a n+=1 if !n!==%%c (echo %%a>>TempDQ.txt) else (echo %%a-%%b-%%c->>TempBQ.txt) )>nul >nul del /s /q Filter.txt,Filtered.txt ::==========运杠单查找统计========== cd. >DaoQi.txt for /f "delims=" %%a in (TempDQ.txt) do ( find /i "%%a" DaoQi.txt||echo %%a>>DaoQi.txt )>nul cd. >BuQi.txt for /f "delims=" %%a in (TempBQ.txt) do ( find /i "%%a" BuQi.txt||echo %%a>>BuQi.txt )>nul >nul del /s /q TempDQ.txt,TempBQ.txt ::==========清除运单号重复========== chcp 65001 echo set shell = WScript.CreateObject^("WScript.Shell"^) >SendKeys.vbs echo shell.SendKeys Wscript.Arguments^(0^) >>SendKeys.vbs echo shell.SendKeys "{ENTER}" >>SendKeys.vbs echo WScript.Sleep 1500 >>SendKeys.vbs call :sound "数据处理完毕,准备键入包裹到齐数据,倒计时大约10秒" ping 127.1 -n 10 >nul set /a num=0 set /a sum=0 for /f "tokens=1" %%a in ( DaoQi.txt ) do ( set /a num=!num!+1 set /a sum=!sum!+1 call SendKeys.vbs %%a echo 本次第!num!条,合计键入!sum!条! if !num!==200 ( call :sound "乙到达单次上限200条,请提交。倒计时15秒" ping 127.1 -n 15 >nul call :sound "开始继续键入任务" set /a num=0 ) ) call :sound "到齐包裹录入任务共键入!sum!条,现乙完毕,提交后按任意键,开始收未到齐包裹!" pause call :sound "准备键入包裹未到齐数据,倒计时大约10秒" ping 127.1 -n 10 >nul set /a num=0 set /a sum=0 for /f "tokens=1" %%a in ( BuQi.txt ) do ( set /a num=!num!+1 set /a sum=!sum!+1 call SendKeys.vbs %%a echo 本次第!num!条,合计键入!sum!条! if !num!==500 ( call :sound "乙到达单次上限500条,请提交。倒计时15秒" ping 127.1 -n 15 >nul call :sound "开始继续键入任务" set /a num=0 ) ) call :sound "未齐包裹录入任务共键入!sum!条,现乙完毕,所有任务全部完成,再见!" del /q SendKeys.vbs exit :sound mshta vbscript:createobject("sapi.spvoice").speak(%1)(window.close) |
发表回复