ok, this is a simplified structure of what i want to do. in one file (*) o have undetermined number of, let say words. in the other file (+) i have also undetermined number of words. also i have a table in the database which has two columns. i wish to search one column of the table for any word stated in the file (*) and than if there is a matched string a want to replace it with a string of the same index(like index in the array - that is why i think a good solution would be turning those files(* ,+) into arrays) in the file (+).
(*)file (+)file
_______ _______
1a1 sss
2b2 ggg
3c3 uuu
4d4 bbb
5e5 iii
6e6 zzz
... ...
table
____________
3j4 | rrr
2b2 | ttt
3w3 | jjj
5e5 | ppp
1s1 | kkk
4d4 | aaa
...
the result should look like :
table
__________
3j4 | rrr
2b2 | ggg
3w3 | jjj
5e5 | iii
1s1 | kkk
4d4 | bbb
...
also never mind about the length of the data let say the two files have the same amount of data but i don't know what the number is and i don't care. P.S. thanks for the reply
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.