Re: Importing lines of variable length from ASCII

Поиск
Список
Период
Сортировка
От Andrej
Тема Re: Importing lines of variable length from ASCII
Дата
Msg-id b35603931002251235j12a86ff6gd5ccd0437b0f4fce@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Importing lines of variable length from ASCII  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Ответы Re: Importing lines of variable length from ASCII  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: Importing lines of variable length from ASCII  ("Louis Becker" <Louis.Becker@leo.na>)
Список pgsql-novice
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



> Regards, Andreas

Cheers,
Andrej


--
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

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

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