while (<>) { s/ ([XYZA]) ([-+]?) ([0-9.]+) /sprintf "%s$2%.3f", $1, $3 /gex; print; }