
批處理如何查找出兩個(gè)txt文本第一列相同的行和不同的行最后由 pcl_test 于 -7-19 07:55想法在新帳號(hào)里每一行帳號(hào) 從 舊帳號(hào) 對(duì)比 如果有重復(fù)的,寫入重復(fù)文檔中(只寫入新帳號(hào)的對(duì)應(yīng)行)如果沒(méi)有重復(fù)的,寫入 沒(méi)有重復(fù)文檔中(只寫入新帳號(hào)的對(duì)應(yīng)行)新帳號(hào).txt 內(nèi)容如下紅色的為重復(fù)的 黑色的沒(méi)有重復(fù)55465465-1231256-555555555554545587-123456-555553256565656-123456-----444444445878899999-123456---666666665898977962-123456-55487舊帳號(hào).txt 內(nèi)容如下55465465-dsafdsafdsa554545587-dsfdsa--5543256565656-fewretety-99956456556656-edsaweqfe54564775525-ewqfewewq我要的最終結(jié)果是得到兩個(gè)文件 但是 舊帳號(hào)跟新帳號(hào)密碼有可能不一樣,還有可能,是多列的 所以我只針對(duì)帳號(hào)對(duì)比! 分別為重復(fù)帳號(hào).txt 內(nèi)容如下55465465-1231256-555555555554545587-123456-555553256565656-123456-----44444444沒(méi)有重復(fù)帳號(hào).txt 內(nèi)容如下5878899999-123456---666666665898977962-123456-55487bat文件內(nèi)容如下
nclick="copycode($('code0'));">復(fù)制代碼
- for /f delims=- tokens=1 %%i in (新帳號(hào).txt)do (
- set nzh=%%i
- for /f delims=- tokens=1 %%i in (舊帳號(hào).txt)do (
- set jzh=%%i
- if /i %nzh%==%jzh% (
- findstr /r/b %nzh% 新帳號(hào).txt>重復(fù)帳號(hào).txt
- goto run
- )
- )
- findstr/r /b %nzh% 新帳號(hào).txt>沒(méi)有重復(fù)帳號(hào).txt
- :run
- )

