Help

Re: Remove white spaces at the beginning of all fields

755 0
cancel
Showing results for 
Search instead for 
Did you mean: 
NICK75
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello,

I would like to not have a space at the beginning of each entries

I think I have to use Trim but My formulas is long and I do not know how to make sure each line and trimmed.

Right now with this formulas each lines as a white space at the beginning (see below)

IF(AND({MARQUES},{DESIGNER}),
{MARQUES} & " X " & {DESIGNER} & "\n",
IF({MARQUES}, " " & {MARQUES} & "\n") &
IF({DESIGNER}, " " & {DESIGNER} & "\n"))&
IF({FABRICATION}, " " & {FABRICATION} & "\n") &
IF(AND({DATATION},{COLLECTION}),
{DATATION} & " - " & {COLLECTION} & "\n",
IF({DATATION}, " " & {DATATION} & "\n") &
IF({COLLECTION}, " " & {COLLECTION} & "\n"))&
IF(AND({PRODUIT},{MODELE}),
{PRODUIT} & " - " & {MODELE} & "\n",
IF({PRODUIT}, " " & {PRODUIT} & "\n") &
IF({MODELE}, " " & {MODELE} & "\n"))&
IF({MATIERES}, " " & {MATIERES} & "\n") &
IF({COULEURS}, " " & {COULEURS} & "\n")&
IF({DETAIL}, " " & {DETAIL} & "\n")&
IF({GRIFFES}, " " & {GRIFFES} & "\n") &
IF({PROVENANCE}, " " & {PROVENANCE} & "\n") &
IF({TAILLES}, " " & {TAILLES} & "\n") &
IF({CONDITION REPORT}, " " & {CONDITION REPORT} & "\n") &
IF({ICONOGRAPHIES}, " " & {ICONOGRAPHIES} & "\n") &
IF({CITES}, " " & {CITES})
 
 (there is a blank at the begining)
 YVES SAINT LAURENT
 ÉDITION LIMITÉE
 1997
 AFFICHE ENV. 47 X 32 CM
 QUELQUES MINI PLIURES, MINI MARQUES
 
thanks in advance 

 

2 Replies 2

TRIM() will remove white space at the beginning and end of the entire string, not at internal line breaks. 

You can use try using TRIM() around each set of fields that would make up a line. 

Or you could use REGEX_REPLACE() to remove all white space next to a line break. 

Overall, I find this sort of concatenation to be very long and there are many, many ways to concatenate text. Find a way that will make sense to your future self so that your future self will be able to maintain the formula. 

NICK75
5 - Automation Enthusiast
5 - Automation Enthusiast

I do not understand where and how to use REGEX_REPLACE() to remove all white space next to a line break but I do know how to write it correctly. and what to put into () ?

Can you be more specific ?

thanks in advance 

here's what I have so far and where should insert and write with REGEX_REPLACE (?????)

 

IF(AND({MARQUES},{DESIGNER}),
{MARQUES} & " X " & {DESIGNER} & "\n",
IF({MARQUES}, " " & {MARQUES} & "\n") &
IF({DESIGNER}, " " & {DESIGNER} & "\n"))&
IF({FABRICATION}, " " & {FABRICATION} & "\n") &
IF(AND({DATATION},{COLLECTION}),
{DATATION} & " - " & {COLLECTION} & "\n",
IF({DATATION}, " " & {DATATION} & "\n") &
IF({COLLECTION}, " " & {COLLECTION} & "\n"))&
IF(AND({PRODUIT},{MODELE}),
{PRODUIT} & " - " & {MODELE} & "\n",
IF({PRODUIT}, " " & {PRODUIT} & "\n") &
IF({MODELE}, " " & {MODELE} & "\n"))&
IF({MATIERES}, " " & {MATIERES} & "\n") &
IF({COULEURS}, " " & {COULEURS} & "\n")&
IF({DETAIL}, " " & {DETAIL} & "\n")&
IF({GRIFFES}, " " & {GRIFFES} & "\n") &
IF({PROVENANCE}, " " & {PROVENANCE} & "\n") &
IF({TAILLES}, " " & {TAILLES} & "\n") &
IF({CONDITION REPORT}, " " & {CONDITION REPORT} & "\n") &
IF({ICONOGRAPHIES}, " " & {ICONOGRAPHIES} & "\n") &
IF({CITES}, " " & {CITES})
 
0 Kudos
 
Reply