Dear community,
I loaded an Excel file where two columns contain more than one line (The cell includes, for example, industry classification of firms--firms can have more than one industry code. The database that I use puts each code in one line in the Excel sheet). When I import the Excel file to Stata something weird happens:
-The value of the cells under that column appears in one line and the carriage returns seem to appear as spaces at the end of the string (when I -br- the data). I tried using the dataex to show you the data. But, dataex does not capture the problem. So, here is how I see the data:
Array
The first line is fine. The second line is supposed to contain these industry codes:
524210
524126
524128
524130
When I count the number of characters for this line, Stata tells me that it has 27 characters (6*4 +3)
But, then I -ltrim- (or rtrim) the variable, there seems to be no space at the end. When I try to list and see the value, I see this:
Array
Here it seems that carriage returns appear as spaces between the 6-digit codes. But, when I try to split this based on spaces, nothing is split.
So, the issue is that the spaces (produced through space carriages in Excel) seem to be at the end of the string when I browse the data. When I list the data, they seem to be between 6-digit codes.
What is going on here? How can I split these industry codes into different cells or put a punctuation mark between them?
Thanks,
Navid
Related Posts with Problem with the data form a multi-line Excel cell
Interpreting regression results if some clusters are not treatedI am a bit confused about how to interpret the regression results in the following scenario: I comp…
Help with specifying a multi-line localDear All, This should be straightforward, but I am really struggling with specifying a multiple line…
Multiple RegressionHello guys, I will run the multiple regression and calculate the expected number of children EVER BO…
sparklines (or similar) with varying y-axis values by caseHello. I wish to graph the within-state (US states) variation of a performance measure over time for…
Data format reshapeDear Statalists, I have one simple question. At the moment, I am dealing with the data which is rel…
Subscribe to:
Post Comments (Atom)
0 Response to Problem with the data form a multi-line Excel cell
Post a Comment