From mboxrd@z Thu Jan 1 00:00:00 1970 From: csoler@euskalnet.net Subject: Re: sed problem Date: Fri, 05 Mar 2004 08:42:46 +0100 Sender: linux-admin-owner@vger.kernel.org Message-ID: <35a8138f03.38f0335a81@euskalnet.net> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Language: es Content-Disposition: inline List-Id: Content-Type: text/plain; charset="iso-8859-1" To: Jens Knoell Cc: Linux Admin Hi Jens, ----- Mensaje Original ----- De: "Jens Knoell" =46echa: Jueves, Marzo 4, 2004 6:08 pm Asunto: sed problem > Oke... sed-hell again. >=20 > Case: I have a file that has lines separated by pipe chars. I need=20 > to split > it back into a line-by-line file. So I tried this (the ^M has been=20 > enteredby pushing Ctrl+V, Enter): > echo "This|should|be|on|separate|lines" | sed -e "s/|/^M/g" >=20 > The result: > linesate >=20 > I'm sure I'm missing something, but hours of googling didn't get me > anywhere. Any ideas? I think awk fits better for this task, IMHO of course :-) csoler@gudu$ echo "This|should|be|on|separate|lines" | awk -F"|" '{for=20 (i=3D1; i<=3D NF; i++) print $i}' This should be on separate lines I hope this helps you... Cheers, C=E9sar - To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html