currently i have doubt regarding how to merge two big files and 1 config files. the 1st files is around 20 Mils records and 2nd one is 400K and 1 config files around 50 records.
due to this, need your help whether we can use perl (using hash) for merging files or using sql database (pl sql) to make it faster.
1. get the 1st, 4th and 6th columns from file 1
2. compare the 4th and 6th columns with config files for the mapping
3. if the mapping is found from 2nd step, compare with file2 by :
a. comparing the 1st column on file1 and 2nd column on file2
b. comparing the 2nd column from config file and 1st column on file2
4. merge into new files by :
a. replacing the 4th column on file1 with 1st column on config file
b. replacing 6th column on file1 with 5th column on config file
c. add the 3rd & 4th column from file2
first files :
2nd files :
config files :
ccode prod, custplan plan_rate new_plan
5 SUPERG30 22 90 100_1d_unlim
10 SUPERM30 22 210 1g_15d_unlim
15 SUPERB30 70 82 700_30d_lim10
25 SUPERC30 70 85 1g_7d_lim5
expected results :
please advice about this
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] |