procmail
[Top] [All Lists]

Re: newline

2002-06-04 19:16:59
On Tue, Jun 04, 2002 at 09:06:32PM +0300, Udi Mottelo wrote:

      But ofcource!   Also:

awk -F"^M" '{print $1}'


Udi,

   This doesn't work for me, possibly because -F specifies the
Field Separator, not the Record Separator. I have more success
with a minor adaptation of your good (faster than sub) idea:

awk '{print $1}' RS='^M'

(Using GNU Awk 3.1.0)

Results:
awk -F"^M" '{print $1}' /tmp/fred | od -x
0000000 7664 6473 6476 0d76 610a 7664 6461 6676
0000020 0d64 0d0a 000a

awk '{print $1}' RS='^M' /tmp/fred | od -x
0000000 7664 6473 6476 0a76 6461 6176 7664 6466
0000020 0a0a 000a

   The first acts as cat. The second removes the carriage
returns (0d).

Regards,
Erik


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>