I have data in this form
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
But i want to convert it into this format
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------
Anyone can share the code if possible
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str23 variablename int year float(alconincswxalc argenxseenxtbrargx astellaspharmainctse4503 astrazenecaplclseazn bayeraktiengesellschaftxtrabayn celltrioninckosea068270 chugaipharmaceuticalcoltdtse4519 cochlearlimitedasxcoh) "Capital Expenditure " 2011 . .308 405.8 839 2098.1 93.7 146.1 86.8 "Capital Expenditure " 2012 . .115 578.6 672 2543.3 14.1 174 21.3 "Capital Expenditure " 2013 . .09 332.6 742 2970.5 6.97 110.2 19.3 "Capital Expenditure " 2014 . .211 284.2 1012 2869.9 28.8 135.5 22.2 "Capital Expenditure " 2015 446 .298 201.3 1328 2733.6 43 152.8 18.4 end
But i want to convert it into this format
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str23 companyname int year float(capitalexpenditure dividendspershare) "Alcon Inc. (SWX:ALC)" 2011 . 0 "Alcon Inc. (SWX:ALC)" 2012 . . "Alcon Inc. (SWX:ALC)" 2013 . . "Alcon Inc. (SWX:ALC)" 2014 . . "Alcon Inc. (SWX:ALC)" 2015 446 0 "Alcon Inc. (SWX:ALC)" 2016 444 0 "Alcon Inc. (SWX:ALC)" 2017 415 0 "Alcon Inc. (SWX:ALC)" 2018 524 0 "Alcon Inc. (SWX:ALC)" 2019 553 0 "Alcon Inc. (SWX:ALC)" 2020 479 .113 "Alcon Inc. (SWX:ALC)" 2021 700 .219 "Alcon Inc. (SWX:ALC)" 2022 636 .227 "argenx SE (ENXTBR:ARGX)" 2011 .308 0 "argenx SE (ENXTBR:ARGX)" 2012 .115 0 "argenx SE (ENXTBR:ARGX)" 2013 .09 0 "argenx SE (ENXTBR:ARGX)" 2014 .211 0 "argenx SE (ENXTBR:ARGX)" 2015 .298 0 "argenx SE (ENXTBR:ARGX)" 2016 .887 0 "argenx SE (ENXTBR:ARGX)" 2017 .414 0 "argenx SE (ENXTBR:ARGX)" 2018 .712 0 "argenx SE (ENXTBR:ARGX)" 2019 1.8 0 "argenx SE (ENXTBR:ARGX)" 2020 1.07 0 "argenx SE (ENXTBR:ARGX)" 2021 3.62 0 "argenx SE (ENXTBR:ARGX)" 2022 . . end
Anyone can share the code if possible
Comment