<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Stripping Blanks from SQL*Plus output in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414721#M861271</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;Does anyone know how to avoid getting blanks at the end of records when spooling to a file using SQL*plus. i.e. if a record ('|' delimited) is spooled as&lt;BR /&gt;&lt;BR /&gt;CL   |CLS|CLS4127        |2001123112     |ABCD   |6895000000|CAN     |GO000|               |IEP|             0|              |            |      |            |PHXJOB      |            |            |            |  |            |                              |            |              |           |              |            |            |            |            |&lt;BR /&gt;&lt;BR /&gt;is there a way to get it to spool as&lt;BR /&gt;&lt;BR /&gt;CL|CLS|CLS4127|2001123112|ABCD|6895000000|CAN|GO000||IEP|0|||||PHXJOB|||||||||||||||&lt;BR /&gt;&lt;BR /&gt;We are using 8.1.7.4&lt;BR /&gt;&lt;BR /&gt;Any Help Appreciated&lt;BR /&gt;&lt;BR /&gt;Michael</description>
    <pubDate>Thu, 04 Nov 2004 05:48:39 GMT</pubDate>
    <dc:creator>Michael Campbell</dc:creator>
    <dc:date>2004-11-04T05:48:39Z</dc:date>
    <item>
      <title>Stripping Blanks from SQL*Plus output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414721#M861271</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Does anyone know how to avoid getting blanks at the end of records when spooling to a file using SQL*plus. i.e. if a record ('|' delimited) is spooled as&lt;BR /&gt;&lt;BR /&gt;CL   |CLS|CLS4127        |2001123112     |ABCD   |6895000000|CAN     |GO000|               |IEP|             0|              |            |      |            |PHXJOB      |            |            |            |  |            |                              |            |              |           |              |            |            |            |            |&lt;BR /&gt;&lt;BR /&gt;is there a way to get it to spool as&lt;BR /&gt;&lt;BR /&gt;CL|CLS|CLS4127|2001123112|ABCD|6895000000|CAN|GO000||IEP|0|||||PHXJOB|||||||||||||||&lt;BR /&gt;&lt;BR /&gt;We are using 8.1.7.4&lt;BR /&gt;&lt;BR /&gt;Any Help Appreciated&lt;BR /&gt;&lt;BR /&gt;Michael</description>
      <pubDate>Thu, 04 Nov 2004 05:48:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414721#M861271</guid>
      <dc:creator>Michael Campbell</dc:creator>
      <dc:date>2004-11-04T05:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Stripping Blanks from SQL*Plus output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414722#M861272</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;try using "replace".&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;YD@MYDB.MU&amp;gt; select&lt;BR /&gt;   replace(&lt;BR /&gt;    replace('CL |CLS|CLS4127 |2001123112 |ABCD |6895000000|CAN |GO000| |IEP| 0| | | | |PHXJOB | | | | | | | | | | | | | | |',' |','|'),'| ','|')&lt;BR /&gt;from dual;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;REPLACE(REPLACE('CL|CLS|CLS4127|2001123112|ABCD|6895000000|CAN|GO000||IEP|0|||||&lt;BR /&gt;PHXJ&lt;BR /&gt;________________________________________________________________________________&lt;BR /&gt;____&lt;BR /&gt;CL|CLS|CLS4127|2001123112|ABCD|6895000000|CAN|GO000||IEP|0|||||PHXJOB|||||||||||&lt;BR /&gt;||||&lt;BR /&gt;               &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Thu, 04 Nov 2004 06:14:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414722#M861272</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-11-04T06:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Stripping Blanks from SQL*Plus output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414723#M861273</link>
      <description>write your own function :&lt;BR /&gt;&lt;BR /&gt;create or replace function trim10blank(&lt;BR /&gt;InString  CHAR&lt;BR /&gt;) return CHAR&lt;BR /&gt;IS&lt;BR /&gt;Begin&lt;BR /&gt;  if InString = '          ' then&lt;BR /&gt;     return ' ';&lt;BR /&gt;  else&lt;BR /&gt;     return InString;&lt;BR /&gt;  end if;&lt;BR /&gt;end;&lt;BR /&gt;####################################&lt;BR /&gt;SQLWKS&amp;gt; select 'AA' || trim10blank('          ') || 'ZZ' from dual&lt;BR /&gt;     2&amp;gt; &lt;BR /&gt;'AA'||TRIM10BLANK('')||'ZZ'                                                     &lt;BR /&gt;--------------------------------------------------------------------------------&lt;BR /&gt;AA ZZ                                                                           &lt;BR /&gt;1 row selected.&lt;BR /&gt;SQLWKS&amp;gt; select 'AA' || trim10blank('        zz') || 'ZZ' from dual&lt;BR /&gt;     2&amp;gt; &lt;BR /&gt;'AA'||TRIM10BLANK('ZZ')||'ZZ'                                                   &lt;BR /&gt;--------------------------------------------------------------------------------&lt;BR /&gt;AA        zzZZ                                                                  &lt;BR /&gt;1 row selected.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Thu, 04 Nov 2004 07:14:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414723#M861273</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-11-04T07:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Stripping Blanks from SQL*Plus output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414724#M861274</link>
      <description>As the Web site has some effect in spaces,&lt;BR /&gt;I attached solution and output.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Thu, 04 Nov 2004 07:17:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414724#M861274</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2004-11-04T07:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Stripping Blanks from SQL*Plus output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414725#M861275</link>
      <description>&lt;BR /&gt;Or you could post process the spooled file with a simple:&lt;BR /&gt;&lt;BR /&gt;perl -pe 's/ +\|/|/g' input &amp;gt; output&lt;BR /&gt;&lt;BR /&gt;This will remove any trailing spaces from a field, but will not remove spaces in the middle of a field.&lt;BR /&gt;&lt;BR /&gt;-p = loop through input and print $_ to output&lt;BR /&gt;-e = program follows on line&lt;BR /&gt;&lt;BR /&gt;s///g  = repeated substitutions in the line&lt;BR /&gt;" +\|" = one or more spaces followed by a |&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2004 09:42:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414725#M861275</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-11-04T09:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Stripping Blanks from SQL*Plus output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414726#M861276</link>
      <description>Hein&lt;BR /&gt;&lt;BR /&gt;Thanks, but the reason I want to strip out the blanks is because the spool file is too big. About 33,000,000 rows would dump to a spool file of around 70Gb.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Michael</description>
      <pubDate>Thu, 04 Nov 2004 09:47:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414726#M861276</guid>
      <dc:creator>Michael Campbell</dc:creator>
      <dc:date>2004-11-04T09:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stripping Blanks from SQL*Plus output</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414727#M861277</link>
      <description>&lt;BR /&gt;Ok, understood. So now it will only be 30GB huh ? :-) :-)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;btw... you might still consider a postprocess solution with perl / awk / ed / tr or whatever your preference is, because contrary to a sqlplus solution it can deal with all fields in one whack.&lt;BR /&gt;You would just have to make sure not to have the spool file land on the disk, but send it to a pipe.&lt;BR /&gt;&lt;BR /&gt;1) Either with a mknod and have a slave process read teh pipe, transform and output&lt;BR /&gt;&lt;BR /&gt;2) or the classic pipe:&lt;BR /&gt;&lt;BR /&gt;echo "@report" | sqlplus -s user/pass | perl 'transform' | gzip &amp;gt; trimmed-and-compressed.rpt.gz&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Thu, 04 Nov 2004 10:12:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/stripping-blanks-from-sql-plus-output/m-p/3414727#M861277</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-11-04T10:12:41Z</dc:date>
    </item>
  </channel>
</rss>

