in reply to Re: Substitute script for a newbie
in thread Substitute script for a newbie

The /x modifier only works for the PATTERN (left side) of the substitution operator; it does not work for the REPLACEMENT (right side). Run your code to confirm.