Question

How to TRIM description field

  • 18 January 2023
  • 2 replies
  • 177 views

Within a BAQ, I need to “trim” our part description to remove any spaces, carriage returns, etc. (so that it can be used in a CSV file for uploading onto the DHL website when shipping parts.

I have tried using the TRIM function, but this only removes spaces from the left or the right of the description, not the middle.

Is there another function that can be used to achieve this?

Thanks.

 

 

 


2 replies

You should be able to use the replace function of space with nothing. replace “ “ with “” for doing special characters you will need to use hex code.

Thanks for your reply.

 

As I don’t want to get rid of all spaces (i.e. single spaces are ok), I did try to use the replace formula with something like:  replace “  “ with “ “ (i.e. replace a double space with a single space).

 

This works, but there are instances of 10 or more spaces.  So I “nested” the above a few times, and it reduced the spaces by a bit but not all (unless I keep on nesting).

 

Just wondering if there is a better formula, as I don’t know what is the maximum number of spaces…

 

PS: For the special characters, I’m currently also using the replace function (for commas, diameter symbols, microns symbols, etc).

 

Reply