topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday March 28, 2024, 11:10 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: text and files  (Read 4068 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,823
    • View Profile
    • Donate to Member
text and files
« on: July 20, 2013, 06:18 AM »
hello

I have a bunch of text files

I want to search for specific block of text (multiline text) and if found in a file to delete that file

also, if found on that file, to delete that text, or the other that that text

how can I perform these actions?

thanks!

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: text and files
« Reply #1 on: July 20, 2013, 06:24 AM »
search for the specific text, and delete the search result files.

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,823
    • View Profile
    • Donate to Member
Re: text and files
« Reply #2 on: July 20, 2013, 06:35 AM »
search for the specific text, and delete the search result files.


you mean to open each file manually, search for the text in an editor that supports block text search, and then delete manually the file?
we are talking about 15,000 files...

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: text and files
« Reply #3 on: July 20, 2013, 06:47 AM »
have you disabled indexing? If not, your computer already knows the content of all your text files!

cyberdiva

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,041
    • View Profile
    • Donate to Member
Re: text and files
« Reply #4 on: July 20, 2013, 08:22 AM »
Another possibility is to use a desktop search engine like the freeware Agent Ransack (I use the commercial version, File Locator Pro, from the same company).  You can tell it what block of text to search for, likely file extensions to look in, and any number of other ways to narrow the search (date, time, size, etc.).  It will be slower than a search engine that indexes your files, but I like the fact that it doesn't index and is thus always up to date.  Once it has identified the files, you can delete them.

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: text and files
« Reply #5 on: July 20, 2013, 09:41 AM »
Another possibility is to use a desktop search engine like the freeware Agent Ransack

+1 for Agent Ransack.
vi vi vi - editor of the beast

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: text and files
« Reply #6 on: July 22, 2013, 03:29 PM »
I want to search for specific block of text (multiline text) and if found in a file to delete that file

also, if found on that file, to delete that text, or the other that that text

These two actions seem to be mutually exclusive, no?  I mean, why "delete that text, or the other that that text" if you're going to delete the file anyway?

At any rate, there are plenty of applications that will find and replace text across multiple files.  Just do some Googling or DDG'ing.  Here's one:

http://www.digitalvo....uk/textcrawler.html