From owner-freebsd-questions@FreeBSD.ORG Sun Mar 14 14:31:03 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DECD616A4CF for ; Sun, 14 Mar 2004 14:31:03 -0800 (PST) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 4188E43D39 for ; Sun, 14 Mar 2004 14:31:03 -0800 (PST) (envelope-from freebsd@stevenfettig.com) Received: (qmail 76584 invoked from network); 14 Mar 2004 22:31:02 -0000 Received: from 66-168-50-57.jvl.wi.charter.com (HELO stevenfettig.com) (66.168.50.57) by relay.pair.com with SMTP; 14 Mar 2004 22:31:02 -0000 X-pair-Authenticated: 66.168.50.57 Message-ID: <4054DD10.5060504@stevenfettig.com> Date: Sun, 14 Mar 2004 16:30:40 -0600 From: "Steven N. Fettig" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6b) Gecko/20040213 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [OT] sed question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2004 22:31:04 -0000 Sorry for posting an off-topic question to the list, but this is somethin that has been driving me nuts for weeks now and I can't figure it out. I want to pass a text file through sed that replaces all whitespaces with a carriage return. I.e., if I have the file my_test_text_document.txt that is a few paragraphs of writing, I want to take the following input: I have just written five paragraphs of absolute jibberish and wish that I could get sed to work the way that I want. Oh how this question has plagued me! And have sed output: I have just written five paragraphs of absolute jibberish and ... you get the point. I can't figure out what the newline character is... I've tried \n \r &\, etc. with no avail. I run the following: sed 's/[ ]/\n/g' my_test_text_document.txt and the output never has a newline added regardless of what I have substituted \n with. I have also used " instead of ' and that hasn't helped... Sorry for the question, but I'd really appreciate the help! Steve Fettig