批处理文件写入<>到文本文件 [英] batch file write <> to text file
问题描述
这是我第一次做这些事情. 基本上,我正在为教堂的歌曲创建一个批处理文件html maker.这就是我所坚持的:
This is my first time doing these things. Basically I am creating a batch file html maker for church songs. This is what I am stuck with:
echo <br> %var17% >>Runfiles\temporary2.txt
基本上var 17是歌词行,我想在其前面添加换行符.我将模板制作者分为三个部分:
Basically var 17 is a line of lyric and I want to add a line break in front of it. I have seperated the template maker into three parts:
- 上半场
- 歌词
- 下半场
这是代码:
@echo off
copy "I:\Build\Files\*.txt"
ren *.txt temp.txt
setlocal ENABLEDELAYEDEXPANSION
set vidx=0
for /F "tokens=*" %%A in (temp.txt) do (
SET /A vidx=!vidx! + 1
set var!vidx!=%%A
)
set var
echo <br> %var17% >>Runfiles\temporary2.txt
TYPE Runfiles\temp1.txt > run.html
TYPE temp.txt >> run.html
TYPE Runfiles\temp2.txt >> run.html
pause
温度1是开始,而温度2是结束,所以我有一个歌词文件,我想在所有字符前面插入一个<br>
元素.
Temp 1 is the beginning and temp2 is the end, so I have a lyric document and I want to insert a <br>
element in front of all of them.
原因是因为我要处理大约100首歌曲,而手动处理却花了很长时间.
The reason is because I have somewhat 100 songs to process and it takes so long to do it manually.
推荐答案
echo ^<br^>
Circumflex是DOS/Win命令行中的转义字符.
Circumflex is the escape character in DOS/Win command line.
这篇关于批处理文件写入<>到文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!