Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 bramvdpoel
		
			bramvdpoel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Can i reduce multiple spaces in a field in the loading script?
Field value from the data is: 165/70TR13 APLUS TL A606 (NEU) 79T *E*
I would like it to be: 165/70TR13 APLUS TL A606 (NEU) 79T *E*
Directory;
LOAD [VDB Articlenr.] as VDBArtikel,
[EAN code] as EAN,
Brand as Merk,
Measurecode as Maat,
Vehicle,
Season,
num([KB price]) as BrutovdBan,
num([Netto Price]) as Netto,
num([Netto Price])*2 as BrutoDubbel,
[Article description] as Omschrijving,
Upper(Brand & Season) as Match
FROM
[..\..\Temp\266032_1.csv]
 
					
				
		
 Colin-Albert
		
			Colin-Albert
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can nest multiple replace statements so if the result of the first replace is two spaces, they are replaced again.
replace(replace(replace(replace(replace(Field,' ',' ') ,' ',' ') ,' ',' ') ,' ',' ') ,' ',' ')
 OmarBenSalem
		
			OmarBenSalem
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try :
replace(Field,' ',' ')
 bramvdpoel
		
			bramvdpoel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Doesn't work, then double spaces become a single space. When there are 10 double spaces it converts into 5 single spaces.
I am assuming that field value from VDBArtikel. Try the attachment using Mapping table. You can reload using the correct path
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		One way could be to use something like this
Table:
LOAD Concat(Field, ' ', Num) as Field;
LOAD Field,
	 RecNo() as Num
Where Len(Trim(Field)) > 0;
LOAD SubField(Field, ' ') as Field;
LOAD * INLINE [
    Field
    165/70TR13  APLUS TL A606                      (NEU) 79T *E*
];
					
				
			
			
				
			
			
			
			
			
			
			
		 
					
				
		
 Colin-Albert
		
			Colin-Albert
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You can nest multiple replace statements so if the result of the first replace is two spaces, they are replaced again.
replace(replace(replace(replace(replace(Field,' ',' ') ,' ',' ') ,' ',' ') ,' ',' ') ,' ',' ')
