|
List Info
Thread: help in deletion part of a line
|
|
| help in deletion part of a line |

|
2007-10-22 17:41:40 |
Is there an easier way by sed or ed to remove strings
(caight by grep) of the sort:
part5.chapter2.text-
where "5" and "2" can be any integer
below 10?
(I know how to delete the *entire* line using ed, but not
just
the first part?
thanks,
gary
--
Gary Kline kline thought.org www.thought.org Public
Service Unix
http://jottings.thought.o
rg http://transfinite.tho
ught.org
_______________________________________________
freebsd-questions freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribe freebsd.org"
|
|
| Re: help in deletion part of a line |
  United Kingdom |
2007-10-22 21:37:13 |
On Mon, Oct 22, 2007 at 03:41:40PM -0700, Gary Kline wrote:
>
> Is there an easier way by sed or ed to remove strings
> (caight by grep) of the sort:
>
> part5.chapter2.text-
>
> where "5" and "2" can be any
integer below 10?
>
> (I know how to delete the *entire* line using ed, but
not just
> the first part?
gilmour% echo testpart5.chapter2.text-test | sed
's/part[0-9].chapter[0-9].text-//g'
testtest
Modify as necessary.
--
Benjamin A'Lee <bma subvert.org.uk>
http://subvert.org.uk/~bm
a/
"The right to search for truth implies also a duty; one
must not conceal
any part of what one has recognized to be true." -
Albert Einstein
|
|
| Re: help in deletion part of a line |
  Australia |
2007-10-22 21:43:49 |
On 23-Oct-07, at 4:11 AM, Gary Kline wrote:
>
> Is there an easier way by sed or ed to remove strings
> (caight by grep) of the sort:
>
> part5.chapter2.text-
>
> where "5" and "2" can be any
integer below 10?
>
> (I know how to delete the *entire* line using ed, but
not just
> the first part?
$ echo 'part5.chapter2.text-' | tr -d '[0-9]'
part.chapter.text-
$ echo 'part5.chapter2.text-' | sed 's/[0-9]//g'
part.chapter.text-
regards,
shantanoo
_______________________________________________
freebsd-questions freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribe freebsd.org"
|
|
| Re: help in deletion part of a line |

|
2007-10-23 14:44:58 |
On Tue, Oct 23, 2007 at 03:37:13AM +0100, Benjamin M. A'Lee
wrote:
> On Mon, Oct 22, 2007 at 03:41:40PM -0700, Gary Kline
wrote:
> >
> > Is there an easier way by sed or ed to remove
strings
> > (caight by grep) of the sort:
> >
> > part5.chapter2.text-
> >
> > where "5" and "2" can be any
integer below 10?
> >
> > (I know how to delete the *entire* line using ed,
but not just
> > the first part?
>
> gilmour% echo testpart5.chapter2.text-test | sed
's/part[0-9].chapter[0-9].text-//g'
> testtest
>
> Modify as necessary.
>
Thanks. I was able to get rid of things likie -567-[text]
from
^, but the part[1-5]. --- OH::: I didn't escape the
"."
Duh::: hit myself in the forehead! ... slinking away... .
gary
> --
> Benjamin A'Lee <bma subvert.org.uk>
> http://subvert.org.uk/~bm
a/
> "The right to search for truth implies also a
duty; one must not conceal
> any part of what one has recognized to be true." -
Albert Einstein
--
Gary Kline kline thought.org www.thought.org Public
Service Unix
http://jottings.thought.o
rg http://transfinite.tho
ught.org
_______________________________________________
freebsd-questions freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribe freebsd.org"
|
|
| Re: help in deletion part of a line |

|
2007-10-23 14:49:58 |
On Tue, Oct 23, 2007 at 08:13:49AM +0530, Shantanoo Mahajan
wrote:
> On 23-Oct-07, at 4:11 AM, Gary Kline wrote:
>
> >
> > Is there an easier way by sed or ed to remove
strings
> > (caight by grep) of the sort:
> >
> > part5.chapter2.text-
> >
> > where "5" and "2" can be any
integer below 10?
> >
> > (I know how to delete the *entire* line using ed,
but not just
> > the first part?
>
> $ echo 'part5.chapter2.text-' | tr -d '[0-9]'
> part.chapter.text-
>
> $ echo 'part5.chapter2.text-' | sed 's/[0-9]//g'
> part.chapter.text-
>
This would help unify my regex since I have
"part7.chapter4.text"
as well as misc other shtuff. (I like tr ... it's easy and
has
many uses... .)
thanks.
gary
>
> regards,
> shantanoo
>
--
Gary Kline kline thought.org www.thought.org Public
Service Unix
http://jottings.thought.o
rg http://transfinite.tho
ught.org
_______________________________________________
freebsd-questions freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribe freebsd.org"
|
|
[1-5]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|