topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 6, 2024, 8:20 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: how to delete text files that have less than x lines  (Read 4077 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
how to delete text files that have less than x lines
« on: September 11, 2007, 08:15 AM »
hello

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

thanks

matt_man22

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 11
    • View Profile
    • Donate to Member
Re: how to delete text files that have less than x lines
« Reply #1 on: September 12, 2007, 01:20 PM »
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

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,149
    • View Profile
    • Donate to Member
Re: how to delete text files that have less than x lines
« Reply #2 on: September 12, 2007, 04:39 PM »
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.