Jason Stelzer on 31 Aug 2010 08:21:08 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Sed or awk help?!

  • From: Jason Stelzer <jason.stelzer@gmail.com>
  • To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
  • Subject: Re: [PLUG] Sed or awk help?!
  • Date: Tue, 31 Aug 2010 11:21:00 -0400
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=nD3hj1l1lDFWmHqD0cW6Yh1F99C5wEiPF5Hs/t0U0Z4=; b=IMi24bDo243tQiMd9BHWVmmXdI7Y0vdzp/bOEYSK2UmpIf6ktnp07eAtf/bc5DZfw3 I9Nstoz37ZFEvJkZv/mpscQ8AY1kM2+0TyBtkWJ3oLN36V8rCzOOFtccGxNDJ6ZdU0pW 31ahHYND2Fd3nivUshqz+da5dln5z3LvDJB58=
  • Reply-to: Philadelphia Linux User's Group Discussion List <plug@lists.phillylinux.org>
  • Sender: plug-bounces@lists.phillylinux.org

So you want to remove the .cel from the end of each line?

echo foo.cel.cel | sed -e 's/\.cel$//;'

The $ anchor will only remove the .cel if it's the end of the string,
that way intermediary and incidental .cel patterns are left alone.

So, cat | sed > newfile

On Tue, Aug 31, 2010 at 11:17 AM,  <Daniel.Roberts@sanofi-aventis.com> wrote:
> Hello
> It has been a VERY long time that I have done any scripting..
> So if you would..could you please help me out??
> I have a file 1.7 million lines long..
> It contains nothing but filenames with a .CEL extension..
> What I need to do is prepare another file of the same type but with the
> .CEL file extension ripped out..
> How can I do this in sed/awk?
> Thanks for any help!
> Dan
> ___________________________________________________________________________
> Philadelphia Linux Users Group     --    Âhttp://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion Â-- Â http://lists.phillylinux.org/mailman/listinfo/plug

Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug