我有一个“信息卡”脚本,用于在FRC竞赛中记录各种团队的小笔记,我想知道是否有一种简单的方法可以添加新行文本文件。 我现在已经设置了它,以便它将标题添加到文本文件,然后允许您通过应用程序输入内容。但是,无论文本片段有多长,内容都显示在文本文件的第一行。在txt文件中添加新行Windows批处理
这是我有:
echo off
color 0a
title [email protected]!
cls
:start
cls
echo This project was created by Liam Powell.
echo ---------------------------------------------------------------------------
echo 1) create new card
echo 2) open current card
echo 3) check current files.
echo 4) clear all files.
set input=
set /p input=
if %input%==1 goto cardcreator if NOT goto start
if %input%==2 goto open if NOT goto start
if %input%==3 goto check if NOT goto start
if %input%==4 goto clearall if NOT goto start
cls
:open
cls
echo enter the card name.
set input=
set /p input=
start C:\Users\Powell\Desktop\Batch-files\Card\cards\%input%.txt
pause
goto start
:cardcreator
cls
echo what do you want the card to be called?
set name=
set /p name=
echo what should the contents be?
set content=
set /p content=
echo %content% >C:\Users\Powell\Desktop\Batch-files\Card\cards\%name%.txt
pause
goto start
:check
cls
dir C:\Users\Powell\Desktop\Batch-files\Card\cards\ /b /o:n
pause
goto start
:clearall
cls
echo Delete all Cards?
set input=
set /p input=
if %input%==yes goto clearalltwo if NOT goto start
if %input%==Yes goto clearalltwo if NOT goto start
if %input%==no goto start
if %input%==No goto start
:clearalltwo
cls
cd "C:\Users\Powell\Desktop\Batch-files\Card\cards\"
del *.txt
pause
goto start
和我的问题是,我将如何让程序让我输入文本增加了多行文本文件,而不是使所有输入的文字之一线? 基本上,之间的区别:
The quick brown fox jumps over the lazy dog. And enjoyed it.
Vs的
The quick brown fox jumps over the lazy dog.
And enjoyed it.
不是。我正在寻找一种方法让文本文件中的文本有多行,我当前的程序将用户在“内容”下输入的内容添加到文本文件中。但是,它只会将其添加到第一行。我试图找到一种方法来分解多行文本。我想要让程序知道每25个字符就应该在文本文件中添加一行。对不起,我的要求没有具体。 – Lpowell
我建议你[编辑你的问题](http://stackoverflow.com/questions/23025483/adding-a-new-line-in-a-txt-file-windows-batch/23026502#23026502)并添加此那里的信息。 – Aacini