Hi.. I have a text file that is used to control a machine. From time to time, I need to edit the file to remove some functions in the machine program. What I need is to be able to add a semicolon to the controls in the program and then reverse this action when I am finished, since the changes will be temporary. I have found scripts to enter something in the beginning of the line, but not like what I need to do. The file structure looks like this:
So, this is how the original file will look. In brackets (D12) is the operation of which I want to skip, so I need to place a semicolon after each "N" Number like so, until I get to the next operation.
To Skip (D12) =
What I would like to be able to do is have an Inputbox to ask "Enter an Operation to Skip" and enter (D12) to place the semicolon where needed, which will be in all lines until the next set of brackets. Any help on this would be great! Thanks
Code:
N0001 (D12)
N0002 X -0.987 Y 0.348
N0003 Z -0.725
N0004 G01 F7.000
N0005 (D13)
N0006 X -0.239 Y 0.212
N0007 Z -0.725
N0008 G01 F7.000
So, this is how the original file will look. In brackets (D12) is the operation of which I want to skip, so I need to place a semicolon after each "N" Number like so, until I get to the next operation.
To Skip (D12) =
Code:
N0001 ;(D12)
N0002 ;X -0.987 Y 0.348
N0003 ;Z -0.725
N0004 ;G01 F7.000
What I would like to be able to do is have an Inputbox to ask "Enter an Operation to Skip" and enter (D12) to place the semicolon where needed, which will be in all lines until the next set of brackets. Any help on this would be great! Thanks