How to put Hex character into REPLACE?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to put Hex character into REPLACE?

Art Kendall
I have a string variable that has an unknown character in the 7th position.
One chart shows it as a line feed
what do I put in the second argument of a REPLACE.
COMPUTE T.crop04 = REPLACE(T.Crop04, something," ").

* pasted from output file.
do if any (26, crop01 to crop10).
print /Record.ID(f8)
 /t.crop04 (AHEX50)
 /t.crop04 (A25).
end if.
execute.
   26713
43656C6572790A4C6574747563652020202020202020202020
Celery
Lettuce
* end paste.



-----
Art Kendall
Social Research Consultants
--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: How to put Hex character into REPLACE?

PRogman
I believe a solution was presented in this thread:
http://spssx-discussion.1045642.n5.nabble.com/how-might-I-get-spss-to-read-this-td5739188.html

in short:

COMPUTE t.crop04 = REPLACE(t.crop04, STRING(10, PIB1), '  ').

HTH, PR



Art Kendall wrote

> I have a string variable that has an unknown character in the 7th
> position.
> One chart shows it as a line feed
> what do I put in the second argument of a REPLACE.
> COMPUTE T.crop04 = REPLACE(T.Crop04, something," ").
>
> * pasted from output file.
> do if any (26, crop01 to crop10).
> print /Record.ID(f8)
>  /t.crop04 (AHEX50)
>  /t.crop04 (A25).
> end if.
> execute.
>    26713
> 43656C6572790A4C6574747563652020202020202020202020
> Celery
> Lettuce
> * end paste.
>
>
>
> -----
> Art Kendall
> Social Research Consultants
> --
> Sent from: http://spssx-discussion.1045642.n5.nabble.com/
>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





--
Sent from: http://spssx-discussion.1045642.n5.nabble.com/

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD