I'm trying to import two Excel files that have multiple sheets to Mathematica using the following code:
SetDirectory["C\\Users\\pablo\\Desktop\\College
FIU\\EIN"];
fileName1 = "env_air_gge-EIN-3235-v01.xls";
fileName2 = "nama_10_gdp-EIN-3235-v02.xls";
CO2EU[2] = Import[fileName1][[2]];
GDPEU[1] = Import[fileName2][[1]];
GDPEU[2] = Import[fileName2][[2]];
This is causing the following error: Syntax::sntxb: Expression cannot begin with "SetDirectory[<<733>>];".
Later I'm trying to extract some parts from the dataset that I imported using this code:
CO2emissions1985 = CO2EU[2][[12;;46, 2]];
CO2emissions1993 = CO2EU[2][[12;;46, 10]];
CO2emissions2001 = CO2EU[2][[12;;46, 18]];
CO2emissions2008 = CO2EU[2][[12;;46, 26]];
CO2emissions2017 = CO2EU[2][[12;;46, 34]];
GDPeurope1985 = GDPEU[2][[11;;55, 12]];
GDPeurope1993 = GDPEU[2][[11;;55, 20]];
GDPeurope2001 = GDPEU[2][[11;;55, 28]];
GDPeurope2008 = GDPEU[2][[11;;55, 36]];
GDPeurope2017 = GDPEU[2][[11;;55, 44]];
Which is causing this error: Part::take: Cannot take positions 12 through 46 in CO2EU[2].
I don't understand why the SetDirectory is giving this error. I would also appreciate if anyone could tell me the best way to extract only some rows and colums from the dataset in Excel. Thank you.
FileNameJoin[{"C:", "Users", "pablo", "Desktop", "College"}, OperatingSystem -> "Windows"]
toSetDirectory
. $\endgroup$ – Rohit Namjoshi Mar 30 '20 at 21:02SetDirectory
. $\endgroup$ – Rohit Namjoshi Mar 30 '20 at 23:03