Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: Splitting the contents of a cell with enter key as the delimiter
From
Dev Vencappa <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: Splitting the contents of a cell with enter key as the delimiter
Date
Tue, 3 Dec 2013 18:09:35 +0000
Nick,
Please ignore my previous email. It was a line feed which was used as a delimiter, and I have now sorted it out with the command:
split fullname,parse(`=char(10)')
Thanks for your helpful pointers and advice.
Regards,
Dev
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: 03 December 2013 17:29
To: [email protected]
Subject: Re: st: Splitting the contents of a cell with enter key as the delimiter
I won't rule out that it could be CR and LF together.
-charlist- (SSC) is a simple utility that identifies characters present in string variables.
Nick
[email protected]
On 3 December 2013 17:08, Nick Cox <[email protected]> wrote:
> That's not enough information for us to identify which character that
> is (Stata sense) but from standard lists e.g.
> http://www.asciitable.com/ it sounds like carriage return or line
> feed. Either way, -split- should be up to it. There is an example in
> the help for -split- showing how to split on tabs, meaning -char(9)-,
> which should be of the same form.
>
> This is one example, where the Statalist convention, urged upon you
> all by the FAQ but adopted only by a few, of flagging syntax with - -
> is really helpful, as in
>
> I am using the -split- command.
>
> Nick
> [email protected]
>
>
> On 3 December 2013 16:46, Dev Vencappa <[email protected]> wrote:
>
>> I am trying to split the contents of a string variable which reads as one long name as below when viewing it in the data editor:
>>
>> Banc of America Securities LLCJP Morgan & Co IncMorgan Stanley
>>
>> But upon closer inspection, this is actually stored with the enter key as a delimiter in the cell as below:
>>
>> Banc of America Securities LLC
>> JP Morgan & Co Inc
>> Morgan Stanley
>>
>> I am trying to use the command split to retrieve and save each of these three business names into three different columns. However, I am not sure how to code split to specify thatthe parser should be the enter key. Can someone please kindly offer a solution to this please? My string variable has thousands such cases where sometimes there are up to 15 different names in the content of a cell delimited using the enter key.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/
This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/