seaching a file

Discussion in 'Java' started by ruds, Jul 13, 2007.

  1. ruds

    ruds Guest

    Hi,
    Is there a way for file searching in which i can find a string which
    occurs after certain interval again in the file?
    The file that i'm dealing with is in GB's so the searching has to be
    fast.
    ruds, Jul 13, 2007
    #1
    1. Advertising

  2. ruds wrote:
    > Hi,
    > Is there a way for file searching in which i can find a string which
    > occurs after certain interval again in the file?
    > The file that i'm dealing with is in GB's so the searching has to be
    > fast.
    >


    Yes!

    --

    Knute Johnson
    email s/nospam/knute/
    Knute Johnson, Jul 13, 2007
    #2
    1. Advertising

  3. And thus spoke ruds...

    > Is there a way for file searching in which i can find a string which
    > occurs after certain interval again in the file?
    > The file that i'm dealing with is in GB's so the searching has to be
    > fast.


    http://www.nist.gov/dads/

    Have fun. You're probably searching for a text searching algorithm like
    Boyer-Moore, but as long as the description is as vague as that, I can't
    say which one will be the best.

    Flo
    Flo 'Irian' Schaetz, Jul 13, 2007
    #3
  4. ruds

    Roedy Green Guest

    On Fri, 13 Jul 2007 03:40:21 -0700, ruds <> wrote,
    quoted or indirectly quoted someone who said :

    >Hi,
    >Is there a way for file searching in which i can find a string which
    >occurs after certain interval again in the file?
    >The file that i'm dealing with is in GB's so the searching has to be
    >fast.


    Do a read starting at the offset, reading the entire file into ram.
    See http://mindprod.com/applet/fileio.html for how.

    Then use String.indexOf or a regex search . See
    http://mindprod.com/jgloss/regex.html

    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jul 13, 2007
    #4
  5. ruds

    Roedy Green Guest

    On Fri, 13 Jul 2007 18:30:33 +0200, Flo 'Irian' Schaetz <>
    wrote, quoted or indirectly quoted someone who said :

    >http://www.nist.gov/dads/
    >
    >Have fun. You're probably searching for a text searching algorithm like
    >Boyer-Moore, but as long as the description is as vague as that, I can't
    >say which one will be the best.


    see http://mindprod.com/jgloss/products.html#BOYER
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
    Roedy Green, Jul 13, 2007
    #5
  6. Flo 'Irian' Schaetz, Jul 14, 2007
    #6
  7. Andrew Thompson, Jul 14, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. imran
    Replies:
    2
    Views:
    12,796
    Rhino
    Mar 3, 2005
  2. LittlePython

    Seaching Active Directory via ADO

    LittlePython, Feb 16, 2006, in forum: Python
    Replies:
    10
    Views:
    979
    LittlePython
    Feb 19, 2006
  3. bruce

    seaching a list...

    bruce, Aug 10, 2006, in forum: Python
    Replies:
    4
    Views:
    355
    Gabriel Genellina
    Aug 11, 2006
  4. KK

    Seaching the data

    KK, Jun 21, 2008, in forum: Java
    Replies:
    2
    Views:
    309
    Arne Vajhøj
    Jun 21, 2008
  5. hgbso

    seaching a txt file

    hgbso, Sep 6, 2008, in forum: C Programming
    Replies:
    0
    Views:
    315
    hgbso
    Sep 6, 2008
Loading...

Share This Page