I need to find ONLY the lines that start with the string G1 Z
, and then replace any occurrence on that same line of F1800
with a new value of F500
. For example:
G1 Z9.800 F1800.000 ; move to next layer (48)
G1 X103.711 Y99.145 F1800.000 ; move to first perimeter point
G1 X96.289 Y96.289 E320.13685 ; perimeter
G1 Z0.000 F1800.000 ; move to next layer (49)
G1 X103.711 Y96.289 E320.44978 ; perimeter
G1 X103.711 Y99.070 E320.56702 ; perimeter
G1 X95.782 Y104.218 E321.13977 F1800.000 ; perimeter
Should become:
G1 Z9.800 F500.000 ; move to next layer (48)
G1 X103.711 Y99.145 F1800.000 ; move to first perimeter point
G1 X96.289 Y96.289 E320.13685 ; perimeter
G1 Z10.000 F500.000 ; move to next layer (49)
G1 X103.711 Y96.289 E320.44978 ; perimeter
G1 X103.711 Y99.070 E320.56702 ; perimeter
G1 X95.782 Y104.218 E321.13977 F1800.000 ; perimeter
I know /^G1 Z
will find these lines, and %s/F1800/F500/g
will replace ALL F1800s, but I can't see how to restrict the replace to the lines starting with that string.
I'm on GVIM 8.0.586.