Dear All,
My file is like the following:
data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947
data_2.dat pre= -444.333 post= -333.545 diff= -777.333
.
.
I hope to find out a regular expression subtitution commad to delete
everything after "dat" to get a file like:
data_1.dat
data_2.da
Xiaoshen Li wrote:
Dear All,
My file is like the following:
data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947
data_2.dat pre= -444.333 post= -333.545 diff= -777.333
.
.
I hope to find out a regular expression subtitution commad to delete
everything after "dat" to get a file like:
My file is like the following:
data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947
data_2.dat pre= -444.333 post= -333.545 diff= -777.333
.
.
I hope to find out a regular expression subtitution commad to delete
everything after "dat" to get a file like:
data_1.dat
data_2.dat
.
.
I kn
Why not just
s/ .*//
?
(For either vim or sed.)
Marshall
On Jul 25, 2006, at 1:09 PM, Tim Chase wrote:
My file is like the following:
data_1.dat pre= -1908.77 post= -48977.33 diff= -448.947
data_2.dat pre= -444.333 post= -333.545 diff= -777.333
.
.
I hope to find out a regular express
Why not just
s/ .*//
Good idea. It should also do the trick. There are
semi-pathological edge cases where the filename contains a space,
for which this might trip it up. Okay, with the other solutions
I proposed, there are sick and perverted edgecases where the
filename has not only a sp