Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI,
i have a list where few values have 2 traling spaces while others don't.
how can I write a generalized code at the time of loading, which will delete the 2 trailing spaces (at end) if applicable else ignore.
Thanks
Sayantan Dutta wrote:
But the moment I do load from SharePoint, 2 extra spaces are getting added at the end, and they are not getting truncated using Trim.
Then they could be non-breaking spaces (unicode char 0xA0 (160)).
PurgeChar([Associate Working On], chr(160)) as Test
HTH
Jonathan
HI,
use
Trim(field) as Field.
Regards
ASHFAQ
Hi Ashfaq,
How the Trim works when the Field consists of more than 1 word?
will
Trim([string1 string2]) as Field
work?
Thanks
Hi,
Can you attach some sample data.
Regards
ASHFAQ
Associate Working On
Abdul Sheikh
Abhay Jagtap
Abhishek Gupta
Abhitanshu Shukla
Associate Working On : is the field name
And few records have 2 spaces at the end
Thanks
Hi ,
if u are merging two field then ,
Try Like this Trim(Field1)&Trim(Field2) as Field
Thanks Saurabh
Trim() removes the spaces from both ends and NOT from within the string. So you get your desired result with trim().
Hi , if u have spaces in right try like this Rtrim(Associate Working On) Thanks
Hi,
have a look at attached application.
use below code
load *, trim([Associate Working On]) as Test1,
Replace([Associate Working On],' ','') as Test2;
load * Inline
[
"Associate Working On"
"Abdul Sheikh "
"Abhay Jagtap"
"Abhishek Gupta"
"Abhitanshu Shukla "
];
Regards
ASHFAQ
Hi,
Your above sample works fine if we do a Inline Load.
But the moment I do load from SharePoint, 2 extra spaces are getting added at the end, and they are not getting truncated using Trim.
LOAD
Trim([Associate Working On]) as Test
FROM
[sharepoint list path]
(html, utf8, embedded labels, table is @4);
I am exporting Test to excel and can see 2 extra spaces added automatically. My data don't have these spaces.
Thanks