Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[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   Nick Cox <>
To   "" <>
Subject   Re: st: Splitting the contents of a cell with enter key as the delimiter
Date   Tue, 3 Dec 2013 17:08:48 +0000

That's not enough information for us to identify which character  that
is (Stata sense) but from standard lists e.g. 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.


On 3 December 2013 16:46, Dev Vencappa <> 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:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index