第27个文件包含以其他字符开头的单词。我设法使用
awk
来完成我的字典,但我必须用
bat
来完成,这给我带来了很多问题。
解释批处理文件,对吗? :-)
@echo off
md folder
for /F "delims=" %%a in (theFile.txt) do (
for %%b in (%%a) do (
set word[%%b]=1
)
)
for %%a in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
(for /F "tokens=2 delims=[]" %%b in ('set word[%%a') do (
echo %%b
set word[%%b]=
)) > folder\%%a.txt 2>NUL
)
(for /F "tokens=2 delims=[]" %%b in ('set word[') do (
echo %%b
set word[%%b]=
)) > folder\other.txt
@echo off
title dictionary
color 0a
echo enter the word you want for its definition.
echo.
set/p A=
if %A%==game GOTO game
ELSE
goto end
:end
Exit
:game
cls
echo.
echo game:a competitive activity involving skill, chance, or endurance on the part of two or more
echo persons who play according to a set of rules, usually for their own amusement or for that of echo spectators.
echo.
pause
:end
Exit