if anybody wants to speed up KoT, either get on lsj to get me the html
version or write
an awk script that will join 2 lines if the first line starts with Name:
I don't know what an awk script is, but perhaps others do?
LSJ, if you don't have George's e-mail, I can forward the file he is
asking for...
best -
chris
> write an awk script that will join 2 lines if the first line starts
> with Name:
>
Uh, how about:
j@salty:~$ cat join.awk
#!/usr/bin/awk -f
BEGIN { s = 0 }
s == 0 && /^Name:/ { line = $0; s = 1; next }
s == 1 { printf line " "; s = 0 }
{ print }
# eof
j@salty:~$ cat test.txt
foo bar
Name: quux frob
snarf
blarg
j@salty:~$ ./join.awk test.txt
foo bar
Name: quux frob snarf
blarg
(though the OP probably had something more complicated in mind)
cheers,
-jakob