Hi everyone,
I have the following example data:
And I want total1 aged blind_disab to look like:
I tried the following code and get the following error:
Any help is much appreciated!
Shree Baba
I have the following example data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str19 A byte B int C long D byte E long F byte G int H byte I long J byte(K L M) int N byte O str1(total1 aged blind_disab) "Total, New York" . . 621937 . 137566 . . . 66822 . . . . . "" "" "" "Albany" . . 6192 . 773 . . . 976 . . . . . "" "" "" "Allegany" . . 1461 . 149 . . . 157 . . . . . "" "" "" "Bronx" . . 86131 . 14126 . . . 12662 . . . . . "" "" "" "Schnectady" . 3814 . . . . 3411 . . . . . 1714 . "" "" "" "Schoharie" . 726 . . . . 600 . . . . . 303 . "" "" "" "Schuyler" . 463 . . . . 382 . . . . . 183 . "" "" "" "Total, Rhode Island" . . . . . . 24084 . . . . . 12370 . "" "" "" "Bristol" . . . . . . 289 . . . . . 140 . "" "" "" "Kent" . . . . . . 2605 . . . . . 1221 . "" "" "" "Newport" . . . . . . 1163 . . . . . 514 . "" "" "" end
And I want total1 aged blind_disab to look like:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long(total1 aged blind_disab) 621937 137566 662822 6192 773 976 1461 149 157 86131 14126 12662 3814 3411 1714 726 600 303 463 382 183 24084 12370 . 289 140 . 2605 1221 . 1163 514 . end
I tried the following code and get the following error:
Code:
clear import excel "C:/ssdi01.xlsx", sheet("Sheet3") edit . gen total1 = "" (11 missing values generated) . gen aged = "" (11 missing values generated) . gen blind_disab = "" (11 missing values generated) . . foreach j of varlist B-O{ 2. foreach i in `j'{ 3. replace total1 = `i' if `i' != . 4. replace aged = `i' if `i' != . 5. replace blind_disab = `i' `i' != . 6. } 7. } type mismatch r(109); end of do-file r(109);
Shree Baba
Comment