In message <[EMAIL PROTECTED]>,
Christopher E <[EMAIL PROTECTED]> writes
>Hello,
>
>I have this table,  I upload data to it, when I do it puts the white
>space after some of the fields (data is from a fixed-width file).
>
>I would like to strip the white space from the start and end of all
>fields either at the point when I move the data from one table to
>another
>
>upload data into irs_rawdata
>use filtering script move the data into query
>
>Thanks ahead of time for the help!

I don't have time to go through all your code (it's Saturday night!),
but are you aware of the MySQL TRIM() function?

Once your records are loaded into irs_rawdata for the first time, you
could clear all the spaces in all the records with one line of SQL, no
need for a loop:
UPDATE irs_rawdata SET firstfield=TRIM( firstfield ),  secondfield=TRIM(
secondfield )... etc


If you must upload it to a second table, then use TRIM() as you upload
it.

-- 
Pete Clark

Sunny Andalucia
http://hotcosta.com/Andalucia.Spain

Reply via email to