回复 34# Rasm
使用gawk,简单高效,删除纯数字和纯字母,只保留字母+数字的行。- @echo off
- gawk -F"|" "BEGIN{IGNORECASE=1}$2~/[0-9][A-Z]|[a-z][0-9]/" 文本.txt>输出.txt
- pause
复制代码 使用纯P,代码稍微多点,删除纯数字和纯字母,只保留字母+数字的行。- @echo off
- (for /f "tokens=1,2* delims=|" %%a in (文本.txt) do (
- for /f "tokens=1,2* delims=0123456789" %%c in ("#%%b") do (
- if not "%%c%%d"=="#" (
- for /f "tokens=1,2* delims=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" %%A in ("#%%b") do (
- if not "%%A%%B"=="#" echo,%%a^|%%b
- )
- )
- )
- ))>输出.txt
- pause
复制代码
|