0
所以我在想這個,這應該就像一個說話的模擬器,如果你寫下批處理文件不知道的東西,它會要求你寫出答案對於該問題,稍後使用問題名稱創建文本文件,並在文本文件中用答案創建一行。唯一的問題是,我不知道如何讓批處理文件讀取文本文件中的行。請幫忙。如何在文本文件中找到一條線
@echo off
echo Hello!
echo Talk To Me!
pause>nul
:1
cls
echo Enter text
set /p talk=
if exist %talk% (
goto answer
) else (
goto dontknow
)
:answer
*finds string in txt file and writes it here*
pause>nul
goto 1
:dontknow
echo I dont know that yet. Teach me what to answer
set /p teach=
echo %teach% >> %talk%.txt
pause>nul
goto 1
[找到](https://ss64.com/nt/find.html)或[FINDSTR](https://ss64.com/nt/findstr.html) – Stephan