On 26 February 2010 00:52, A. Kretschmer
<andreas(dot)kretschmer(at)schollglas(dot)com> wrote:
> kretschmer(at)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