Re: Trim file with sed

From: alexs (spam_at_alexs.org)
Date: 10/29/05


Date: 29 Oct 2005 04:03:57 -0700


Kelvin Moss wrote:
> Hi all,
>
>
> I have a file format where two parts are delimited by a newline (\n)
> character. I need to get the file after the \n character. I tried this
> but it gets me the \n character too in o/p.
>
>
> E.g. if file is
> a
> b
> c
>
>
> d
> e
>
>
> then I want
> d
> e
> as o/p.
>
>
> I tried this sed expression -- sed -n '/^$/,$p' <file> but it doesn't
> do the desired effect. Can anyone help me here?
>
>
> Thanks.

You could do it with grep.
Something like

 cat FILE | grep "" -x -A 10000
 
(or bigger number for -A if the file is really big!)



Relevant Pages

  • Re: Trim file with sed
    ... > I have a file format where two parts are delimited by a newline ... I need to get the file after the \n character. ... > as o/p. ...
    (comp.unix.programmer)
  • Trim file with sed
    ... I have a file format where two parts are delimited by a newline ... I need to get the file after the \n character. ... but it gets me the \n character too in o/p. ...
    (comp.unix.programmer)
  • Trim file with sed
    ... I have a file format where two parts are delimited by a newline ... I need to get the file after the \n character. ... but it gets me the \n character too in o/p. ...
    (comp.unix.shell)
  • Re: Trim file with sed
    ... > I have a file format where two parts are delimited by a newline ... I need to get the file after the \n character. ... > as o/p. ...
    (comp.unix.shell)
  • Re: Memmove v/s Linked list Implementation
    ... "Remove all occurrences of a character (case ... She will be a massless princess ... o/p: he will be a male prince ... My friend implemented the solution by creating a Linked List of all the ...
    (comp.lang.c)