1.

Solve : Batch delete file with one line?

Answer»

Hi Friends,
I have many FILES in directory. Each file have different line. (some file have 1 line some file have more lines)
I want to have batch file to delete file that have only 1 line.

Thank youThis should echo the del command with the files of only 1 line. Remove the echo if it WORKS ok.

Code: [Select]@echo off
for %%a in (*.*) do (
for /f %%b in ('find /C /v "" ^<"%%a" ') do if %%b EQU 1 echo del "%%a"
)
Thanks for your script foxidrive

You are a suppermanHe has BREAKFAST once in awhile as WELL...And I like soup, so I guess you could say that that makes me a souperman.



Discussion

No Comment Found