Character replacement
Pickering, John (NORBORD)
John.Pickering at norbord.com
Tue May 4 09:42:56 CDT 2010
You didn't indicate which PowerHouse component you wanted to do this
with. Here's a bit Qdesign code which removes weird characters from
screen input. It was designed to get rid of ASCII characters less than
the space, principally the tab character, but you could easily adapt it
to remove pipes of whatever.
TEMP T-WORK-TEXT CHAR*50
TEMP T-REMOVED INT*2
PROCEDURE INTERNAL STRIP-WEIRDIES
BEGIN
; strip out any weird characters
LET T-REMOVED = 0
LET T-WORK-TEXT = FIELDTEXT
FOR 50
IF " " GT T-WORK-TEXT[OCCURRENCE:1]
THEN BEGIN
LET T-WORK-TEXT &
= " " + T-WORK-TEXT[1:OCCURRENCE - 1] &
+ T-WORK-TEXT[OCCURRENCE + 1:50]
LET T-REMOVED = T-REMOVED + 1
END
IF T-REMOVED GT 0
THEN BEGIN
IF "" = T-WORK-TEXT[1:T-REMOVED]
THEN LET FIELDTEXT = T-WORK-TEXT[T-REMOVED + 1:50]
END
END
PROCEDURE INPUT DESCRIPTION
BEGIN
IF 0 NE SIZE(FIELDTEXT)
THEN BEGIN
DO INTERNAL STRIP-WEIRDIES
LET FIELDTEXT = LJ(FIELDTEXT)
END
END
________________________________
From: powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com
[mailto:powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com] On
Behalf Of Grace, Ron (Chipping Sodbury) UK
Sent: Tuesday, May 04, 2010 7:15 AM
To: powerh-l at lists.sowder.com
Subject: Character replacement
Using Powerhouse on a HP3000
I have three 60 character comment fields that sometimes contain the '|'
character, which causes problems as we use this as a delimiter when
exporting files to an external application. I want to run a
search/replace before the export to replace this character with a space.
What's the easiest way to do this.
<monster sig snipped>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20100504/e90e8772/attachment.htm
More information about the powerh-l
mailing list