@echo off
setlocal enableextensions enabledelayedexpansion
set "_list="
for %%f in ("*error*.csv") do (
for /F %%l in ('type "%%~ff" ^| find /c /v "" ') do (
if %%l gtr 1 set "_list=!_list! %%~nxf"
)
)
echo %_list%
endlocal
For each file which meets the naming condition, count the number of lines and, if greater than 1 concat to variable.