Tue, 01 Mar 2005, by g.lams@itcilo.org:
Hi
Thanks for the reply.
Do not toppost again please, it's a pita to keep threads orderly that way.
I wanted to use one unique command to keep in the new file only the Message-ID, the Subject, the From, and the "Body". For the time being I run those two commands sequentially. Actually it's not a blocking problem. The fast is that I want to import those files in mysql, and, for what I now, I need to have a file like this: field1:field2;field3;filed4
I can do this for the first three fields but the forth one is like this: <body> <p> xghdgdfgfgdff </p> <p> xgdsfssdfsdf fsdfsfsdfhdgdfgfgdff </p> </body>
What I would need is to have everything on one row, i.e removing the carrigare return. Is there a way to do it?
#v+
awk '/Message-ID/ || /Subject/ || /From/ || /Newsgroups/ \
{printf "%s\n", $1 >"headers.txt"};
/<body>/,/<\/body>/ {printf "%s;", $1 >"body.txt"}'