Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: joining word/ lines in a file

Re: joining word/ lines in a file

From: <Jared.Still_at_radisys.com>
Date: Thu, 30 May 2002 10:48:47 -0800
Message-ID: <F001.00470082.20020530104847@fatcity.com>

> If isn't perfect. An 'and' at the end of the line will be joined with
> the beginning of the next line, which is not right.

Don't strip the newlines, replace them with white space:

J: D'oh! I should have known that.

    perl -e 'undef $/; ($a=<ARGV>) =~ s/\n+/ /g; print $a' \

        [file [file...]] [<file]

will convert nearly anything you can give it into a nice, clean, single line.

J: that doesn't work when there are '--' comments in the SQL. Removing the comments is not an option, they may include hints.

If you want to get things neater than this see the examples in Parse::RecDescent.

J: Haven't investigated that yet, should give it a try.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: Jared.Still_at_radisys.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu May 30 2002 - 13:48:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US