Greetings, Perlmonks! I come bearing a conceptual problem. Frankly, it's not something that requires Perl - besides the fact that I'll be coding the solution in Perl - but there's a bunch of smart people here, a number of whom are smart in exactly the ways that this problem needs. I'd be grateful for any help.

Here's the problem: I have a rather large (2MB+) cross-reference stored in a text file that's TSV-formatted and arranged in a grid - labels across the top, cross-referenced numbers across each line. The first column is more or less the reference column: that's what was originally used for looking up the data in the other columns - and the number in that first column can be repeated on several lines if there's more than one cross-referenced product for any given vendor.

The way things used to be done was pretty simple: find the product in the first column, look up the x-refs for all the other vendors. What I'd like to do is to expand that: I want to be able to either 1) select any vendor, enter that vendor's part number, and get all the x-refs from all the vendors for that part, and 2) enter just the part number and be presented with a list of all matches, with vendor names, at which point I'd go back to #1.

I can do a single instance of any of these fairly easily - loop over, build a hash, etc. What I'm having trouble doing is coming up with 1) an efficient way of storing the data (should I reformat/reorganize it for easier lookups, and if so, how? Should I stuff it into a database? Why?) and 2) a usable interface (this latter particularly makes me feel stupid; I'm usually very good at interfaces.) I guess it's only partially a programming problem; mostly, I'm just frustrated at being stuck, and need a push to get past the point of stuckness.

Ideas to get my brain rolling again would be highly and gratefully welcomed. Thanks in advance to all who try.


--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf

In reply to Organizing and presenting a cross-reference by oko1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.