|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello all,
I need to delete empty lines from a file (with spaces only - not null records). The following command works only for null rows, but not in case of spaces: sed '/^$/d' filename thanks in advance! |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
2007-11-06, 03:11(-08), shulamitm:
> I need to delete empty lines from a file (with spaces only - not null > records). The following command works only for null rows, but not in > case of spaces: sed '/^$/d' filename [...] grep '[^[:blank:]]' filename awk NF filename -- Stéphane |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
shulamitm wrote:
> > I need to delete empty lines from a file (with spaces only - not null > records). The following command works only for null rows, but not in > case of spaces: sed '/^$/d' filename [GNU sed & grep] sed '/^ \+$/d' filename or grep -v '^ \+$' filename -- Best regards | Be nice to America or they'll bring democracy to Cyrus | your country. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Nov 6, 1:18 pm, Stephane CHAZELAS <this.addr...@is.invalid> wrote:
> 2007-11-06, 03:11(-08), shulamitm:> I need to delete empty lines from a file (with spaces only - not null > > records). The following command works only for null rows, but not in > > case of spaces: sed '/^$/d' filename > > [...] > > grep '[^[:blank:]]' filename > > awk NF filename > > -- > Stéphane thanks! |
|
![]() |
| Outils de la discussion | |
|
|