Does anyone know of a way to strip carriage returns from a char field? We have fields in our data base used for notes, and i need to output them to a file. I need the notes to be on one line, though, and when I put stream the field it includes the carriage return. I have ot use put stream instead of export because I have multiple output files generated in this report. Anyone have any ideas?
foo = REPLACE(foo,"~r","") /* strip cr */
foo = REPLACE(foo,"~n","") /* strip lf */
Julian
--
Julian Lyndon-Smith
IT Director, Dot R Limited
"I don’t care if it works on your machine! We are not shipping your machine!”
Follow Dot R on http://twitter.com/DotRlimited
foo = REPLACE(foo,"~r","") /* strip cr */
foo = REPLACE(foo,"~n","") /* strip lf */
That will completely strip off the CR/LF.
If line by line processing is required we usually consider the text as being a CR delimited list:
DO i = 0 TO NUM-ENTRIES (foo, "~n"):
PUT UNFORMATTED ENTRY (I, foo, "~n") SKIP.
END.
That's right. If you use both lines The OP wanted to know
"Does anyone know of a way to strip carriage returns from a char field?"
yes - use example #1