Community discussion forum

search text in files

  • 2 months ago

     People upload doc files on my website. As soon as they upload a file, I would like to check if they contain a boolean search string ( ex: medical and ("colo*" and cancer)) . I need to check the file for a few of these search terms  and send an alert to the appropriate requestors.

    I am already using idexing services and if the resquestor asks for all files which contain a certain search term, I use a sql query on the catalog.

    The problem is: the file which is just uploaded is not necessary indexed yet. therefore it may not be found and checked. Is there a simple code or function  in (C# please) which will allow me to check if a file contains a search string?

     

    Thanks

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 2 months ago

    Hi,

    I am not sure the above approach will be very effective.

    Doc files are from MS Word and will be in their proprietary format.  While it does store the text unscrambled in there, it does add extra characters to denote table endings etc.

    You are probably better using either regualar expressions to do the searching, or open the file using com objects and then using com interaction to search the file.  If you go the com route, then i think you will need MS Word installing on the web server to register the components necessary to interact with the word documents.

    Please feel free to correct me on that last point if i am wrong.

    Regards

    Simon C

Post a reply

Enter your message below

Sign in or Join us (it's free).