Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default indexing flat files

    Hi,

    I have a file (about 3-4 MB ) with about 20000 records
    in it. I need to create an index on a particular field
    (integer ) in each record. But there might be multiple
    records matching a particular field value. My queries
    are something like,
    "Get all records with the A < field value < B"

    This looks like an ideal candidate for a DBMS solution
    like MySQL but I do not have it. Is there any way I
    could do this efficiently in Perl. Will the DB_File
    module be usefull( I know very little about this ).
    Can anyone please help?

    Thnx.

    Siva.

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    [url]http://sitebuilder.yahoo.com[/url]
    Siva Sai Guest

  2. Similar Questions and Discussions

    1. Verity errors when indexing PDF files
      We have problems indexing pdf files and the sysinfo.log reports 100reds of messages like the following: Error E0-1514 (Drvr): Locale:locuni: Locale...
    2. Temporary Flat Files
      I have an ASP 3 application that I am converting to and improving with ASP.NET. This application creates two temporary flat files and appends them...
    3. indexing html files with php
      Hello all, this must be something that a lot of people have been looking for, and probably found solutions for, but i can't seem to find anything...
    4. DB2 and Flat files
      Hi, I'm new in DB2. Can anyone tell me whether there is any command in DB2 to batch update the contents of a flat file into a DB2 table. ...
    5. How to create .deb of flat files?
      Hi All! I've got a handful of regular flat text files that I would like to make into a .deb but I'm not familiar with doing anything that doesn't...
  3. #2

    Default Re: indexing flat files

    Hi,

    this is just an Idea and maybe it is the worst idea for what you want. But I
    'll go for it :-)

    What I would do-- I have an Index(sorted)
    Then the main file with the 20,000 records would be a DBM just a tied or
    dynamic or a hashed text.
    using the module
    SDBM_File, POSIX modules
    And the index would be the address or Key of the record in a main file.
    like in the index sorted by integers
    you would have
    YOUR INTEGER | ADDRESS or key

    where Address would be the row in the main file.
    when you create the 'tied' file, you can have a counter.
    foreach $line(@data){
    $c++;
    ($int, $othervalue)=split(/\|/,$line);
    $dbm{$c}= $line;
    push @tobegotoindex, "$int|$c\n";
    }

    just an idea.
    That is what I used to do with Visual Basic.

    awards


    Awards Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139