Re: pls/sql help please

  • From: Tim Gorman <tim@xxxxxxxxx>
  • To: eugene.pipko@xxxxxxxxxxxx
  • Date: Thu, 28 Jan 2010 12:50:55 -0700

Try something like TRIM(REPLACE(SUBSTR(vLine,...,...), chr(9), ' ')) to replace the tab-chars with space-chars so that TRIM() can do its job the way you want it to?  Also, allows any non-trailing tab chars to be preserved as delimiters, if need be?


Eugene Pipko wrote:

Hi all,

I have the following line in the file in the text file being sent to me (just an example):

 

x                                              16         18         20         22         24                     <- tab (hidden)

 

Very last character on that line is TAB character.

I am trying to account for that, but for some reason can’t catch it:

 

vSize_field := TRIM(SUBSTR(vLine,C_SIZE_FIELD_START,C_SIZE_FIELD_LEN));

vSize_id := sc_get_size_fn(vSize_field,' ');

 

WHILE ( vSize_field IS NOT NULL OR TRIM(vSize_field) <> ' ' OR TRIM(vSize_id) <> CHR(9) )

LOOP

   -- store values in collection

   vNext_row := NVL(sc_size.LAST,0)+1;

   sc_size(vNext_row) := vSize_id;

  

   -- progress down the line

   C_SIZE_FIELD_START := C_SIZE_FIELD_START + C_SIZE_FIELD_LEN;

  

   -- retrieve current values

   vSize_field := TRIM(SUBSTR(vLine,C_SIZE_FIELD_START,C_SIZE_FIELD_LEN));

   vSize_id := sc_get_size_fn(vSize_field,' ');

 

END LOOP;

 

What am I missing?

Thanks,

 

 

Eugene Pipko

Seattle Pacific Industries

office: 253.872.5243

cell: 206.304.7726

P  Please consider the environment before printing this e-mail

 

-- //www.freelists.org/webpage/oracle-l

Other related posts: