in reply to Re: More Flat-File Database Questions
in thread More Flat-File Database Questions

Complete Rewrite? You got that right! This was one of my first scripts. It's a modification of a freebie I found. I fully intend on rewriting it, but I'm trying to find out how to do what I said above in this post.

I know I could change it from $item_number to $scottnum, but that wouldn't work because some of those numbers contain letters in them and there are multiple items for nearly each Scott number. Any other ideas?

  • Comment on Re: Re: More Flat-File Database Questions

Replies are listed 'Best First'.
Re: More Flat-File Database Questions
by eg (Friar) on Feb 11, 2001 at 22:58 UTC

    So what does $scottnum actually look like? Can you give some example of the mixing of letters and numbers? If the letters in $scottnum are irrelevant to the selection process, you can quash them out with

    $scottnum =~ tr/0-9//cd;

    or, if the irrelevant bit is at the end of the number, just do the comparisons on the int( $scottnum ).

    It doesn't matter that there are multiple entries for each scott number, since each line is treated independently in the selection process. If you have "100a" and "100b", they'll both be in the range [0, 200].

Re: More Flat-File Database Questions
by Anonymous Monk on Mar 14, 2002 at 20:58 UTC
    Hi Stamp_Guy, i'm trying to make the same database you did, but i'm in troubles with some thimgs. Could you send me code of it, like de CGI and some lines of the txt database? Thanks Miguel