Search for a String within a document (Word, txt, doc) using JSP, JAVA

Hi
I have created a little application that uses combination of JSP and HTML. Users of this application can upload documents which are then stored on the server. I need to develop functionality where I can allows users to search for a string within a document. More precisely, user would type in some string in a text box and application will search all uploaded documents for that string and return the downloadable links to those documents that contains that string. I have never done this before. I was wondering if someone could get me started on this or point me to some thread where this idea is already discussed. Any Jave code exists for searching through documents??
Thanks for your help
Riz

http://www.ibm.com/developerworks/java/library/j-text-searching.html
http://en.wikipedia.org/wiki/Full_text_search
Type these parameter in yahoo:+efficient text search
you will need something like openoffice library to read microsoft word document.

Similar Messages

  • Searching for a string within a file

    In control panel \ folder options \ search tab  I've selected "always search file names and conents (this might take several minutes).  and under "how to search" I have checked all 4 boxes.     Yet, when I search a folder
    and all sub-folders for a file containing a string Windows 7 finds nothing.  in XP this worked perfectly.  How do you search like this in Windows 7?   I actually had to write a PowerShell script that does the search for me and I thought Windows
    7 could do this by default but I guess not?!?!?
    mqh7

    Hello mqh7.
    You can use the find command from the Windows 7 command prompt window.
    Open a command prompt window and run find /? to have more informations about the command syntax or read the command documentation available
    here in TechNet Library.
    Bye.
    Luigi Bruno
    MCP, MCTS, MOS, MTA

  • Searching for a substring within a string

    can someone reccomend a simple way to search for a substring within a string and count the number occurences of that substring.
    The substring and the string will be provided as command line parameters.
    Thanks
    gg

    A simple way would be to use the indexOf methods in String:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html
    Not sure what this has to do with event handling though :-P

  • Is Safari Find function flexible? (Search for inner strings of characters?)

    I'm running 10.6.8 with Safari Version 5.1.7 (6534.57.2). I see that when you search a web page using the Safari Find function, you can only search for the beginnings of words, not for character strings within the words. Is it possible to expand the Find function's capability to search for inner strings of characters?

    use command F or the edit menus to make the page search box visible - click the magnify/arrow icon at the left side of it - choose "contains" or "starts with".

  • Search for a space within a text field

    Hi All
    I am trying to search for a sapce within a text field but sofar not being very successful. I have used:
    FIND search_str
               IN text_str
               MATCH COUNT  lv_mcnt
               MATCH OFFSET lv_moff.
    where search_str = TYPE c VALUE ' '.
    I am looking a way of searching a character within the string using ABAP (like INSTRING in other languages). If you have similiar codes - Could you please post me a copy - Thanks

    HI
    Check this..
    DATA string7(30) TYPE c VALUE 'This is a little sentence.'.
    WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
    ULINE /1(26).
    SEARCH string7 FOR 'X'.
    WRITE: / 'X', sy-subrc UNDER 'SY-SUBRC',
                   sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR 'itt   '.
    WRITE: / 'itt   ', sy-subrc UNDER 'SY-SUBRC',
                       sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR '.e .'.
    WRITE: / '.e .', sy-subrc UNDER 'SY-SUBRC',
                      sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR '*e'.
    WRITE: / '*e ', sy-subrc UNDER 'SY-SUBRC',
                    sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR 's*'.
    WRITE: / 's* ', sy-subrc UNDER 'SY-SUBRC',
                    sy-fdpos UNDER 'SY-FDPOS'.
    Thanks ,
    Praveen

  • How can I search for a string like a partial IP address in the global search

    When searching for a string like "10.255." the global search finds messages containing "255" or "10" and both.
    This happens no matter whether quotation is used or not.
    When quotation is used it probably will match on the given order as well, but beeing in the timezone '+0100' the string "10" is always found first (in the email headers...).
    Is there a way to tell the global search not to use '.' or any other character as whitespace?

    When searching for a string like "10.255." the global search finds messages containing "255" or "10" and both.
    This happens no matter whether quotation is used or not.
    When quotation is used it probably will match on the given order as well, but beeing in the timezone '+0100' the string "10" is always found first (in the email headers...).
    Is there a way to tell the global search not to use '.' or any other character as whitespace?

  • How do i search for a string in a txt file using java??

    How do i search for a string in a txt file using java??
    could you please help thanks
    J

    Regular expressinos work just fine, especially when
    searching for patterns. But they seem to be impying
    it's a specific group of characters they're looking
    for, and indexOf() is much faster than a regex.If he's reading from a file, the I/O time will likely swamp any performance hit that regex introduces. I think contains() (or indexOf() if he's not on 5.0 yet) is preferable to regex just because it's simpler. (And in the case of contains(), the name makes for a very clear, direct mapping between your intent and the code that realizes it.)

  • How to search for a string in ALL Function Modules source code

    Hello,
    I want to search for the string "HELLO" in all FUNCTION MODULES source code(FM, no reports/programs).
    Is this possible? How?
    Cheers,
    Andy

    hi,
    Execute RPR_ABAP_SOURCE_SCAN to search for a string in the code ... Press where-used-list button on the program which takes to the function group or the function module where it is used ..
    Regards,
    Santosh

  • Searching for a string in an excel file and return true if found.

    How can I search for a string in an excel file and return true if found, its location and also a value.

    The problem with searching an excel file is that it contains a header. It would be easiest if you just read the file into a LabVIEW array and search the array. This way you can also get the index and the value of the location.

  • Search for a String in a list of files

    Could anyone please send me a java sample code which searches for a string from a list of files and returns me the filename and the line in which the Search String was found ?
    Thanks in advance
    RR

    Simple solution would be -
    1. Traverse a directory for each file.
    2. Read each file using Buffered Reader.
    3. Use readLine() method to read a line.
    4. Use String.indexOf to see if the data which you are looking for is there in the line or not.
    5. If its there then store the line number and file name.
    6. When the loop will end you will have list of file name and line number where the data which you are looking for is present.

  • Search for a song within a playlist in iTunes 11

    I just want to know how do I search for a song within a playlist. I don't want to search the entire music library just one single playlist.

    Got it. I have to deslect the Search Entire Library in the search field

  • Search for a string in SAP Script

    Hello Experts,
    Is there a way to search for a string in all Z SAP scripts, like ABAP source scan?
    Regards,
    Hari.

    Try using function module "READ_FORM" (you will have to write a simple z-program to find all SAPscripts in your system then use this function module to search the SAPScript Forms for a particular string).
    All you have to do is supply the "FORM" name and it will return all of the Pages, Paragraphs, and Texts etc....
    More specifically, try looping at the "FORM_LINES" internal table result and you will see the SAPScript text there....
    Have fun    !
    Edited by: Christopher Twirbutt on Sep 16, 2009 12:43 AM

  • [svn:fx-trunk] 11593: Advanced CSS fix - descendant selectors should search for arbitrary ancestors including when the universal selector is used .

    Revision: 11593
    Author:   [email protected]
    Date:     2009-11-09 15:20:36 -0800 (Mon, 09 Nov 2009)
    Log Message:
    Advanced CSS fix - descendant selectors should search for arbitrary ancestors including when the universal selector is used.
    QE notes: Please add test cases for arbitrary ancestor depth that involve using the universal * selector. Thanks for the additional testing on this patch too!
    Doc notes: N/A
    Bugs:
    SDK-23213 - descendent selectors can't catch components more than one level down
    Reviewer: Corey
    Tests run: Checkintests, test case
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-23213
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSSelector.as

    Welcome guy -
    Unless you are using Spry menus as a learning experience, you should move forward to a menus system that will display properly on the millions of portable devices that won't work with Spry which was deprecated 2 years ago.
    Many are using JQuery menus or pure HTML/CSS menus.
    If you wish to continue your Spry for learning experience, we'll be glad to assist; please let us know.
    By the way, your submenus are not showing because you need to add the red value to this rule in your vertical CSS
    ul.MenuBarVertical ul.MenuBarSubmenuVisible{
        width: 220px;
        left: 180px;

  • Search for White space within strings

    create table emp_dtl
    (empname varchar2(23));
    Insert into emp_dtl values ('WAYNE');
    Insert into emp_dtl values ('JOSEPH KRUPP');     --------- has white space
    Insert into emp_dtl values ('YING ZONG LEE');    --------- has white space
    Insert into emp_dtl values ('COHEN');
    Insert into emp_dtl values ('MARIE');How can i search for empnames which has White space in it? From other OTN threads, I gathered that this has something to do with
    chr(32)But i don't know how to put this in LIKE operator.

    Hi,
    SELECT  *
    FROM    emp_dtl
    WHERE   REGEXP_LIKE (empname, '\s')
    ;will look for any kind of whitespace (including spaces, which are CHR (32)).
    It may be more efficient to specifically list all the different whitespace characters, and see if the string changes when you remove all of them:
    SELECT     *
    FROM     emp_dtl
    WHERE     empname != TRANSLATE ( empname
                           , 'x ' || CHR (9)     -- CHR (9)  = <tab>
                                          || CHR (10)     -- CHR (10) = <newline>
                                 || CHR (13)     -- CHR (13) = <return>
                           , 'x'
    ;Edited by: Frank Kulash on Jul 12, 2010 8:47 AM

  • Search for a String in a File?

    hi all
    is there a methid in java with which i can open a file and
    search for a specified string in the file? i also have to
    replace the String then.
    Thanks angela

    There is no magic method that can do all this for you. First you need to create an inputstream from the file you want to read. Then you can read it (without necessarily store the whole file in memory), until you find a match. If you want to replace the string with another string of the same length, you can use RandomAccessFile. If not, then you will have to move all the rest of the file forward or backwards when you replace the string, or write the whole file modified to a new file and then delete the old file before you rename the new updated file.
    Or you can depending on what you do, append changes to the end of the file, more or less like what is done with Word documents. And then only once in a while update the file with all the appended changes.

Maybe you are looking for