How would i replace a string in a file such that the string to be replaced is always succeeded by some string.
eg: If i want to replace ABC with 123 as below,
INPUT
ABC
ABCXYZ
ABCDHD
ABC
CDE
OUTPUT
ABC
123XYZ
123DHD
ABC
CDE
i tried using sed but with no success.
ABC, match the literal ABC!\(.+\)match at least 1 other character capture it in group 1123\1replace the hole thing with 123 followed by what is captured in group 1