ren myFile.txt myFile.txt.old
findstr /v /b /c:",,," myFile.txt.old > myFile.txt
Rename file as .old. Find all the lines not containing ",,," at the begin of line in old file and save it to original file.
EDITED - to adapt to comments
If lines to be removed are those with only commas (i will include spaces) and no other value, then this should work
for %%t in (c:\path\*.txt) do (
ren "%%~ft" "%%~nxt.old"
findstr /v /r /c:"^[, ]*$" "%%~ft.old" > "%%~ft"
)
For each file in path, rename the file to *.old
, from this .old
file extract any lines not containing (/v
) the regular expression (/r
) defined by the pattern (/c
) : "from the start of line (^
), followed by any sequence of spaces and commas ([, ]*
) until reach the end of line ($
)". The extracted lines are send to the original filename.