Re: Importing lines of variable length from ASCII

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Importing lines of variable length from ASCII
Дата
Msg-id 20100226055127.GA11413@a-kretschmer.de
обсуждение исходный текст
Ответ на Re: Importing lines of variable length from ASCII  (Andrej <andrej.groups@gmail.com>)
Список pgsql-novice
In response to Andrej :
> On 26 February 2010 00:52, A. Kretschmer
> <andreas.kretschmer@schollglas.com> wrote:
> > kretschmer@tux:~$ cat file.txt | awk  '{cols=split($0,a,"|"); if (cols==4) print $0; else printf ("%s|\n",$0)}'
>
> Slightly shorter variant:
> awk -F'|' '{if(NF<4){print $0"|"}else{print $0}}' file.txt

Morning,

Hey, yeah, thx.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How many columns can I have in an ORDER BY clause?
Следующее
От: Jasen Betts
Дата:
Сообщение: Re: Leap Years