Look at sub dump_csv_line() at Re^9: String Search (its in second code posting there). That sub with one line in it dumps the data as a CSV line. If you wanted a simple array, then my @array=map{$curr_record{$_}}@csv_order); would do it. I put that single line of csv dump code in a sub all by itself to try to make its function very clear. I guess this wasn't clear enough! Code really didn't need join or map, could have been like this :

#another way to dump values in record foreach my $tag (@csv_order) { print "Tag = $tag value =$curr_record{$tag} \n"; }

Looks like you have two types of data, as per my example run: "DWLCCN6",'6CBFD7'H.... A string or I guess what is a binary hex value. I would assume that if your DB can export the data in that way, it can import that format also! I wouldn't think that your Perl program has to do any data conversion at all!

So for your questions:
1. Code I gave you already processes records. That "dump subroutine" gets called once per record.
2. "fast" is irrelevant..its not gonna make any difference considering the number of days already spent on this!

I still think your best bet is to take the DB guy out for a nice lunch and have him/her write a simple DB merge thing for you. Then you are done!


In reply to Re^11: String Search by Marshall
in thread String Search by kallol.chakra

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.