如何从文本文件中读取并将其内容设置为变量?

时间:2016-11-04 16:12:00

标签: batch-file

我想记住我的节目我写的是什么数字

我的程序看起来像这样

@echo off
:: Here i want to read the file Numbers.txt
:: If it find Numbers.txt goto Read numbers if not continue
cls
set /p Number1="Enter the number > "
cls
echo First number is %Number1% > Numbers.txt
echo Number saved
cls
set /p Number2="Enter the number > "
echo Second Number is %Number2% >> Numbers.txt
:: And loop trough this like 10 Times
exit


:ReadNumbers
echo Numbers are %number1%, %number2%, %number3%, %number4%, %number5%
pause
exit

但我不知道该怎么做 我想写这个“第一个数字是”等。我想输出如下:数字是%number1%,%number2%,%number3%,%number4%,%number5% 没有“第一个数字是”

谢谢 -RPochyly

0 个答案:

没有答案