Hi group,

This works in a single pass without regard for the QUOTES or NULL environment 
settings:

(SRPL(.vText,CHAR(32),NULL,0))


Regards,

Stephen Markson
The Pharmacy Examining Board of Canada
416.979.2431 x251

From: 'Karen Tellef' via RBASE-L <[email protected]>
Sent: January 16, 2020 4:56 PM
To: [email protected]
Subject: Re: [EXT] Re: [RBASE-L] - Removing embedded spaces from a text string

At one time, the ''  didn't work with SRPL.  I remember that whenever it was 
introduced I knew immediately that I could use that!

Karen



-----Original Message-----
From: mike.ramsour <[email protected]<mailto:[email protected]>>
To: rbase-l <[email protected]<mailto:[email protected]>>
Sent: Thu, Jan 16, 2020 3:34 pm
Subject: Re: [EXT] Re: [RBASE-L] - Removing embedded spaces from a text string
Just a follow-up to the previous.

I tried the suggested approach and it worked very well.  I did one pass through 
the data looking for 5 spaces and then did one more pass looking for 2 spaces.

Command example:  UPDATE TEST_TABLE SET NEW_COMMENTS = (SRPL(COMMENTS,'     
','',0)) WHERE COMMENTS LIKE '%     %'

Problem solved.

Thank you so much.


Mike Ramsour
AK Steel Coshocton Works
Quality Department
Phone:  740-829-4340
Cell:  740-502-1659



From:        "'Karen Tellef' via RBASE-L" 
<[email protected]<mailto:[email protected]>>
To:        [email protected]<mailto:[email protected]>
Date:        01/16/2020 04:16 PM
Subject:        [EXT] Re: [RBASE-L] - Removing embedded spaces from a text 
string
________________________________



You can't get SRPL to work? This is what I would do:

set var vtext2 = (SRPL(.vtext, '     ', '', 0))

What that is:  the first part in the quotes I just spaced 5 times.  The second 
part is just two single quotes together with nothing between.

I've done this before with an UPDATE command.  Create another column to hold 
the result and do repeated UPDATEs until there's no more values with the extra 
spaces.  Of course you'd have to have an idea of how many UPDATEs you would 
need to take care of the extra spaces.


Karen




-----Original Message-----
From: mike.ramsour <[email protected]<mailto:[email protected]>>
To: rbase-l <[email protected]<mailto:[email protected]>>
Sent: Thu, Jan 16, 2020 1:03 pm
Subject: [RBASE-L] - Removing embedded spaces from a text string

Good afternoon:

What's the best way to remove embedded spaces from text strings?

I have a column named COMMENTS that contains text prose similar to this:

'COLD MILL CHATTER                                VERY LITE'

I want to remove any occurrence of 2 or more spaces in a row so that I end up 
with a value like this:

'COLD MILL CHATTER VERY LITE'

I have experimented with the various TRIM functions as well as SRPL but have 
not had any success yet.

I'm looking for the same functionality as the TRIM () function in Excel.

Any help is greatly appreciated.

Best regards.

Mike Ramsour
AK Steel Coshocton Works
Quality Department
Phone:  740-829-4340
Cell:  740-502-1659
Confidentiality Notice
This message is intended exclusively for the individual or entity to which it 
is addressed and may contain privileged, proprietary, or otherwise private 
information.
If you are not the named addressee, you are not authorized to read, print, 
retain, copy or disseminate this message or any part of it. If you have 
received this message in error, please notify the sender immediately by e-mail 
and delete all copies of the message.
--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.rbase.com%2fsupport%2fusersgroup_guidelines.php&c=E,1,EIoWej-BZA6i0RnrN-EoeORAR4uBcU_j_g5gNmu8FX1iVDN5SfUzlrzR8Ou8r7T-Td88PgByOTx2RkfusxTl7FuEWNUYvzJC2SGYPblQ_TsH0f1ge4MpHw,,&typo=1>
---
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/OF633DC4EF.8B6FCEE6-ON852584F1.0067DC43-852584F1.0068B53F%40aksteel.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2frbase-l%2fOF633DC4EF.8B6FCEE6-ON852584F1.0067DC43-852584F1.0068B53F%2540aksteel.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,VqE__9ddyP1jaJIedNmwo17ecS0SFu0EeZSFCmcrwsZ7W7Hg4rX_eWQwEYRGP8_t-oZ4Rr4K9wcfcyYPncNLxmxtrA12wL2IxCR8zoTno78xZ79V6ZM,&typo=1>.
--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.rbase.com%2fsupport%2fusersgroup_guidelines.php&c=E,1,we0JYEhYItLOGsT6csus4T27h6QGp9nZh21EtH-1cfJ5jPvbQ-w4C2DI3g4GgsSggpEFihuhsQPfWXNOznerqPnng8-iOl9_hGJWWCJIN8bhLNmuPLc_9x5VXw,,&typo=1>
---
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/372186748.14679710.1579209383931%40mail.yahoo.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2frbase-l%2f372186748.14679710.1579209383931%2540mail.yahoo.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,PUEAZdnZhYIqwWm5LX70E7xOEbUTC3bZa1tTnlgzTjqPwVAsMD9rSD3eFDrOUUjd2Jt5orq_D45uj5oqBJ6J78_9Z1zQ74A-QyK0Uiaayg4RVB48&typo=1>.

Confidentiality Notice
This message is intended exclusively for the individual or entity to which it 
is addressed and may contain privileged, proprietary, or otherwise private 
information.
If you are not the named addressee, you are not authorized to read, print, 
retain, copy or disseminate this message or any part of it. If you have 
received this message in error, please notify the sender immediately by e-mail 
and delete all copies of the message.
--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.rbase.com%2fsupport%2fusersgroup_guidelines.php&c=E,1,WpSrK4vn-P8rCicdxeThW0yl1CCfffXQ9Pj5bHdIVe76ez4-JmIg_vDUrNqeqlnB0c1LgeeumypQoAg3gGtImXbNI1mQ0TbQbpq4Hpvsc7YvaPPJfJTtcv-7SeTv&typo=1>
---
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rbase-l/OFF5BE31CD.AF3259B0-ON852584F1.00761AAB-852584F1.00768150%40aksteel.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2frbase-l%2fOFF5BE31CD.AF3259B0-ON852584F1.00761AAB-852584F1.00768150%2540aksteel.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,qmhw9OXZg2mbB27yjdopE1sOZ9joNqjLOjDDHpDfhKZcTHR-5PCARkm2egPfhqpXsI2w03kh23kN3hSHxeCzzPMD7qPW4Z188L5RL8JyZkI,&typo=1>
.
--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php<https://linkprotect.cudasvc.com/url?a=http%3a%2f%2fwww.rbase.com%2fsupport%2fusersgroup_guidelines.php&c=E,1,4BZfFJHP-ugquwhvCPMEAbCyYsYf-eFRLGN_1egNJN_Qw7R0LtFTKIBKb7agy3BBK35WPu0_arMKnA9J13Le6n-_jssg_ARJk1qL5Lrib-mWYBFXfsM,&typo=1>
---
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/173767968.14696081.1579211762564%40mail.yahoo.com<https://linkprotect.cudasvc.com/url?a=https%3a%2f%2fgroups.google.com%2fd%2fmsgid%2frbase-l%2f173767968.14696081.1579211762564%2540mail.yahoo.com%3futm_medium%3demail%26utm_source%3dfooter&c=E,1,GpLN0HSK7T8QDSJ24B3Dpd29OmLvCOm1xJgcH5jDtYwpyRFdlUoJHzyALkrC041UsXpfREQ8tZ5z0DP2jp7qxNFpRSiEaCbvlivrLavYNaN9FzyIq6Thlg,,&typo=1>.

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/YTXPR0101MB116527BD7593B2CB967685EAD6310%40YTXPR0101MB1165.CANPRD01.PROD.OUTLOOK.COM.

Reply via email to