Hi Mark,

Although I am not a sed expert, I guess you want to use sed for that
kind of thing. Something like

sed -e 's/\([0-9]\)\(-\)\([0-9]\)/\1 -\3/g' whateverfile

should do the job. As I said, I am not too well acquainted with sed,
so maybe it even does not need to be as complicated as I have written
it, but it should work correctly. This line is searching for sequences
of three subexpressions, with the first subexpression being [0-9], the
second -, and the third again [0-9]. It then replaces all occurrences
with a sequence of the first subexpression, " -", and then the third
subexpression.

Cheers,

Helmut.


On Mon, 25 Nov 2002, Mark Carey wrote:
...
> Some of my lines of data do not have sufficient space between the
> previous column and the next column, e.g.
>
> 2.354647E10-0.56495E-9 0.6758E4
> Note the ^^ missing space, now I was wondering if it was somehow
> possible to use a regexp to look for the pattern [0-9]-[0-9] and
> replace with [0-9] -[0-9], note the extra space. This should not get
> tripped up on the E, if my understanding of regexp is correct.
...

+----------------+
| Helmut Walle   |
| [EMAIL PROTECTED] |
+----------------+


Reply via email to