I have a text file that looks like that:
Joe,message,red,red,red,blue,red,blue,red,red,red,red Herbert,joe is ok and so is dan,red,red,red,blue,red,blue,red,red,red, +red Default,for people with cert, but no profile,red,red,red,blue,red,blue +,red,red,red,red Nobody,for peoplw with no cert,red,red,red,blue,red,blue,red,red,red,r +ed Joe Doe,test,red,red,red,blue,red,blue,red,red,red SSS,2,1,sandbox,1,1,1,1,1,1,1

And these are what I am getting from the form parameters, on the headers.
http://mypage.com/new/test.pl?opt_1=2&opt_2=1&opt_3=sandbox&opt_4=1&op +t_5=1&opt_6=1&opt_7=1&opt_8=1&opt_9=1&opt_10=1&ins_company=SSA&t=s

How do I write a program to read the text file above and search for the first element of the line (it will be the id of what I am loooking for to do the changes) and based on that replace all the elements on the text file with the ones on the headers above? Thank you very much

In reply to Text Files by Anonymous Monk

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.