Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • September 02, 2015, 05:34:49 AM
  • Proudly celebrating 10 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 2007 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,369
    • View Profile
    • Donate to Member
how to delete text files that have less than x lines
« on: September 11, 2007, 08:15:19 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:22 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,085
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: how to delete text files that have less than x lines
« Reply #2 on: September 12, 2007, 04:39:08 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.