No BSD License  

Highlights from
Text File Search

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 16.51 KB File ID: #15025

Text File Search

by Aman Siddiqi

 

17 May 2007 (Updated 18 May 2007)

Search text files using a list of terms, one at a time

| Watch this File

File Information
Description

This file uses a list of search terms in excel. That way the search terms can easily be updated. It searches each text file in a specific directory, one search term at a time. If one is found, that search stops & it moves to the next text file. The results are outputted in an excel file with the original file name in one column, and the found term in another.

I wrote this for a specific usage at work. So its not a general script. But you can use it to start from and modify my code instead of starting from scratch. For instance, if one of the search terms is found for any text file, the script also searches another small set of search terms in the script itself because those require If statements. That can be removed.

You could for instance have the file renamed instead of outputting to a spreadsheet. This script will give you a basis. I utilized another members script to actually do the text searching. My file more helps you build it into a larger process.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data import Aman Siddiqi 22 Oct 2008 09:12:58
data export Aman Siddiqi 22 Oct 2008 09:12:58
search find txt text notepad list items hits Aman Siddiqi 22 Oct 2008 09:12:58
search find txt text notepad list items hits phanikumar vallabhaneni 27 Apr 2011 01:37:19

Contact us at files@mathworks.com