ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

how to delete text files that have less than x lines

(1/1)

kalos:
hello

how can I delete all the text files that have less than 3 lines inside a folder?

thanks

matt_man22:
I assume you are using Windows?

I know in linux it is a simple "wc -l" command.  Maybe that could help in some way.  Not sure how to do it in Windows.

AbteriX:
There are unix-tools-for-windows packs available and there are wc.exe included.

With plain DOS commands this is a lill bit difficult,
maybe "for /f" could help, loop this three times and if errorlevel >0 then delete this file <???>

Real solution would be an AutoHotkey script .... but you have asked this there already, so i will wait what happens.

Navigation

[0] Message Index

Go to full version