Windows 更改:使用管道(|)

Windows 更改:使用管道(|),windows,command-line,Windows,Command Line,我有很多文本文件,我需要在末尾附加文件名。我只有DOS命令可用。我使用以下方法在开头添加了名称: findstr "^" *.txt >new.dat. 不幸的是,我无法使用findstr“$”*.txt new1.dat追加到末尾。 我无法理解为什么$(应该是[line position:end of line])不起作用 我试图用|(管道)替换文件中的:(冒号字符)。我使用以下脚本: @echo off setLocal EnableDelayedExpansion for /

我有很多文本文件,我需要在末尾附加文件名。我只有DOS命令可用。我使用以下方法在开头添加了名称:

findstr "^" *.txt >new.dat. 
不幸的是,我无法使用
findstr“$”*.txt new1.dat
追加到末尾。 我无法理解为什么
$
(应该是[line position:end of line])不起作用

我试图用
|
(管道)替换文件中的
(冒号字符)。我使用以下脚本:

@echo off setLocal EnableDelayedExpansion  
for /f "tokens=* delims= : %%a in (new1.dat) do ( echo "%%a| >>new2.dat ). 
该文件如下所示:

batch-2016-03-14-08-50-05.txt:6530635|GB|150316|6530635.png
batch-2016-03-14-08-50-08.txt:6530636|GB|150316|6530636.png

我只想用管道(
|
)替换

要附加到文本文件的末尾,只需回显'blah'>>textfile.txtry这个“在“&]|^之间包含字符的行可能会被错误处理。”我想,
for/f
findstr
在DOS中不存在,但仅在Windows上存在?