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

st: replacing carriage return/linefeed in text strings


From   Devra Golbe <[email protected]>
To   [email protected]
Subject   st: replacing carriage return/linefeed in text strings
Date   Tue, 14 Jan 2003 14:37:39 -0500

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/




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