DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: text and files  (Read 5,906 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
text and files
« on: July 20, 2013, 11: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,565
Re: text and files
« Reply #1 on: July 20, 2013, 11:24 AM »
search for the specific text, and delete the search result files.

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: text and files
« Reply #2 on: July 20, 2013, 11: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,565
Re: text and files
« Reply #3 on: July 20, 2013, 11: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
Re: text and files
« Reply #4 on: July 20, 2013, 01:22 PM »
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

  • what am I doing in this handbasket?
  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
    • Participated in NANY Challenge Once
Re: text and files
« Reply #5 on: July 20, 2013, 02:41 PM »
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

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: text and files
« Reply #6 on: July 22, 2013, 08: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.digitalvolcano.co.uk/textcrawler.html

Original address: https://www.donationcoder.com/forum/index.php?topic=35508.0