How can I do this? I couldn't find any way of specifying the CR/LF
characters so that I can use them in a COMPUTE command. Isn't there anything
like an ANSI or ASCII function that allows me to refer to these characters
by their character table numbers?
--
Andreas Völp
Psy Consult Scientific Services
Frankfurt, Germany
Andreas Völp schrieb:
For clarity, this code deals with the cr and lf separately, Change
the second line to use '' as the replacement character if you want
only a single blank.
compute strvar = replace(strvar, string(10, ib1),' ').
compute strvar = replace(strvar, string(12, ib1),' ').
HTH,
Jon Peck
SPSS
Thanks a lot - this is exactly what I was looking for (although I must admit
that I still can't find this application of the STRING function anywhere in
the documentation ... but it works, so who cares?).
BTW: LF is ANSI character no. 13, not 12 ;-)
Best regards,
Andreas
The string function converts the numeric value given as the first
argument into a string using the format specified as the second
argument. ib stands for integer binary, so it works like the ord
function in some languages. And, yes, LF is 13 or x0D. Sorry about
that part.
The last time I looked, LF was 10 and CR was 13 ;-)