Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: replacing carriage return/linefeed in text strings


From   "Steichen, Thomas" <[email protected]>
To   <[email protected]>
Subject   st: RE: replacing carriage return/linefeed in text strings
Date   Tue, 14 Jan 2003 14:52:58 -0500

The ASCII code for CR (carriage return) is 13 and for LF 
(line feed) is 10.  The char() function should allow you 
to specify these characters, but whether they will work
in index() via index(stringvar, char(13)) or 
index(stringvar, char(10)), I don't know.

Tom


> -----Original Message-----
> From: Devra Golbe [mailto:[email protected]] 
> Sent: Tuesday, January 14, 2003 2:38 PM
> To: [email protected]
> Cc: Devra Golbe
> Subject: st: replacing carriage return/linefeed in text strings
> 
> 
> Listers,
> 
> I have a data file which includes several string variables 
> which evidently 
> contain an end-of-line character, as in the following
> 
> list consid in 1/2
> 
>                             consid
>    1.                CASH
> NOTE
> LIA
>    2.                         CASH
> 
>   I'd like to break the string variables into multiple 
> variables using the 
> end-of-line character as a delimiter (and ultimately eliminate the 
> end-of-line character).  Because there are about 1400 
> observations I'd like 
> to avoid doing this by hand.  I know I can search using the 
> index function: 
> index(stringvar, s2), but I don't know how to represent the 
> end-of-line 
> character  for s2.  Any help would be appreciated.
> 
> 
> Thanks,
> Devra
> 
> 
> .
> 
> 
> ______________________________________________________________
> Devra L. Golbe, Professor
> Dept. of Economics
> Hunter College  / CUNY
> 695 Park Ave., NY, NY 10021
> voice:  212-772-5408
> fax:     212-772-5398 (office)
>            208-361-5964 (e-fax)
> 
http://econ.hunter.cuny.edu/faculty/golbe

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

-----------------------------------------
CONFIDENTIALITY NOTE:  This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information.  If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system.  Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be unlawful.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index