findstr 没有按预期保存新文件

findstr is not saving new file as expected

我使用了这个命令,在使用 findstr 搜索查询后创建了一个新文件

find /c "Total record count" Movements_*.csv.old   && ( findstr /v /c:"Total record count" Movements_*.csv.old >> result.csv)

这是在 result.csv 中保存的预期结果,但是在数据前后添加了 Movements_20150317,如下所示:

"Movements_20150317.csv.old:AGREEMENT,CURRENCY,MARGIN TYPE,AGREEMENT BRANCH NAME,AGREEMENT BRANCH CIS CODE,NOTIONAL LABEL,IDMovements_20150317.csv.old:"

请指教,这个怎么去掉?

谢谢!!

试试这个:

find /c "Total record count" Movements_*.csv.old   && ( for %a in (Movements_*.csv.old) do @findstr /v /c:"Total record count" "%~a" )>result.csv