Find and replace
Posted: Wed Mar 11, 2009 11:04 pm
Hi, i have to replace several codes in a list with the following format
E1K2S0 L3X0B3;L3X3O9
E1K6H3 L2O5C9;L5F1O1;L5G0I5
E1K6I4 L3V7I5
E0J9A7 L2M5G1
E1K6K6 L3V9T8
E1K6L7 L5D8T1
E1K6M8 L2O7Y3
E1K6M8
E1K6L7;E1K6M8
E0J9A7
E1K6H3;E1K2S0
The list is divided in two parts. The firts one is where i have the codes to find and its replacements.
In the example i have to find E1K2S0 and replace with L3X0B3;L3X3O9
Then i have to find E1K6H3 and replace with L2O5C9;L5F1O1;L5G0I5
and so on until the final of the first part, in the example the last line i have to find is E1K6M8 and replace with L2O7Y3.
The codes to find and replace are separated by tab (\t).
The resulting file for these example is:
L3X0B3;L3X3O9 L3X0B3;L3X3O9
L2O5C9;L5F1O1;L5G0I5 L2O5C9;L5F1O1;L5G0I5
L3V7I5 L3V7I5
L2M5G1 L2M5G1
L3V9T8 L3V9T8
L5D8T1 L5D8T1
L2O7Y3 L2O7Y3
L2O7Y3
L5D8T1;L2O7Y3
L2M5G1
L2O5C9;L5F1O1;L5G0I5;L3X0B3;L3X3O9
THANKS for the help
E1K2S0 L3X0B3;L3X3O9
E1K6H3 L2O5C9;L5F1O1;L5G0I5
E1K6I4 L3V7I5
E0J9A7 L2M5G1
E1K6K6 L3V9T8
E1K6L7 L5D8T1
E1K6M8 L2O7Y3
E1K6M8
E1K6L7;E1K6M8
E0J9A7
E1K6H3;E1K2S0
The list is divided in two parts. The firts one is where i have the codes to find and its replacements.
In the example i have to find E1K2S0 and replace with L3X0B3;L3X3O9
Then i have to find E1K6H3 and replace with L2O5C9;L5F1O1;L5G0I5
and so on until the final of the first part, in the example the last line i have to find is E1K6M8 and replace with L2O7Y3.
The codes to find and replace are separated by tab (\t).
The resulting file for these example is:
L3X0B3;L3X3O9 L3X0B3;L3X3O9
L2O5C9;L5F1O1;L5G0I5 L2O5C9;L5F1O1;L5G0I5
L3V7I5 L3V7I5
L2M5G1 L2M5G1
L3V9T8 L3V9T8
L5D8T1 L5D8T1
L2O7Y3 L2O7Y3
L2O7Y3
L5D8T1;L2O7Y3
L2M5G1
L2O5C9;L5F1O1;L5G0I5;L3X0B3;L3X3O9
THANKS for the help