I have a file that I need to replace a string in but the string occurs more than once. I only want to replace the first occurance of the string. This is driving me crazy. I can only figure out how to change both not one. Here is an example of the file I am working with.
%
O0001
T21
S2000M3
G0X0Y0
M22 ( I want to replace this line)
M24 ( I want to replace this line)
Allot of other code lines
M22 ( I want to leave this alone)
M24 ( I want to leave this alone)
M30
If amyone can point me to a function to help out it would be appriciated.
Thanks in advance,
Wil