in reply to Re^9: String Search
in thread String Search

Dear Marshall,

Thanks a lot for you code. It is working fine. But it has been very complex to process.

Can you please help me two things? 1. How Can I run a loop that will take the data between CME20CP6.CallDataRecord.uMTSGSMPLMNCallDataRecord to CME20CP6.CallDataRecord.uMTSGSMPLMNCallDataRecord without braces and the data will store in a array. Because after taking all the data I have to convert the data to decimal or binary according to the CDR Logic. 2. Which is the faster way to insert a row in a table using DBI.

Replies are listed 'Best First'.
Re^11: String Search
by Marshall (Canon) on Sep 12, 2009 at 20:19 UTC
    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!