I got some output file, with a bug. I can't correct the source code, as it is not mine. The output is a table of numbers (14 columns, hundreds of rows) that look like "1.5398E+02" (format of X.XXXXE-YY ). The bug is that if the power has three digits, so the number look like "6.4492-137" (missing the "E"). I been told to run a "sed" with something like:
sed ' s/([0-9]\.[0-9]{4})-([0-9]{3})/\1E-\2/' model.txt > modelCorrect.txt
or maybe
sed ' s/([0-9]\.[0-9]{4})-([0-9]{3})/([0-9]\.[0-9]{4})-E([0-9]{3})' model.txt > modelCorrect.txt
But it doesn't work (sed: -e expression #1, char 39: invalid reference \2 on s' command's RHS or sed: -e expression #1, char 63: unterminated s' command). What am I doing wrong?