Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Command line 将文本文件的内容封装在元素标记中,并将输出写入XML文件_Command Line_Dos - Fatal编程技术网

Command line 将文本文件的内容封装在元素标记中,并将输出写入XML文件

Command line 将文本文件的内容封装在元素标记中,并将输出写入XML文件,command-line,dos,Command Line,Dos,如何在文本文件的内容中预先添加开始标记,将其附加一个结束标记,并将输出重定向到命令行中的XML文件?对于DOS: echo "<tag>" > file.xml type file.txt >> file.xml echo "</tag>" >> file.xml echo”“>file.xml 键入file.txt>>file.xml echo“>>file.xml 将创建该文件,如果该文件存在,则将其截断,并且>将附加到该文件 什么

如何在文本文件的内容中预先添加开始标记,将其附加一个结束标记,并将输出重定向到命令行中的XML文件?

对于DOS:

echo "<tag>"  > file.xml
type file.txt >> file.xml
echo "</tag>" >> file.xml
echo”“>file.xml
键入file.txt>>file.xml
echo“>>file.xml

将创建该文件,如果该文件存在,则将其截断,并且
>
将附加到该文件

什么命令行?什么贝壳?磁盘操作系统Bash?你可以把这3行放在
.bat
文件中并调用它。