Find / replace value based on second value same line
Posted: Sun Jun 13, 2010 1:51 am
Hello,
I am trying to find / replace a line in a text file where the frist value must be replaced based on the second value and the second value must be replaced always with "1".
<CUSTOMER cust_sid="ABCDEFGH123" sbs_no="100" cust_id="123455678" store_no="2" status="0">
I need to replace sbs_no="100" with sbs_no="102" which is the value of sbs_no="100" plus store_no="2"
and the old value of store_no="2" must be allways store_no="1".
So, the new line should be:
<CUSTOMER cust_sid="ABCDEFGH123" sbs_no="102" cust_id="123455678" store_no="1" status="0">
I really appreciate any help. Thanks in advance.
Marcelo.
I am trying to find / replace a line in a text file where the frist value must be replaced based on the second value and the second value must be replaced always with "1".
<CUSTOMER cust_sid="ABCDEFGH123" sbs_no="100" cust_id="123455678" store_no="2" status="0">
I need to replace sbs_no="100" with sbs_no="102" which is the value of sbs_no="100" plus store_no="2"
and the old value of store_no="2" must be allways store_no="1".
So, the new line should be:
<CUSTOMER cust_sid="ABCDEFGH123" sbs_no="102" cust_id="123455678" store_no="1" status="0">
I really appreciate any help. Thanks in advance.
Marcelo.