In[]:=
ClearAll["Global`*"];(*GeneralClearAllGlobalVariablesStatement.*)L=Import["C:\\Users\\churc\\Google Drive Churchboy316\\Education\\Mathematica\\list data.xlsx"];(*IimportedthetablefromanExcelfileIcreated.*)L=Flatten[L,1];(*Theimportedasa3dimensionalmatrix.So,Iflatteneditonelevel.*)Grid
,Spacings{1,1}(*Thisoutputshowsthedataimportedcorrectly.*){col,row}=Dimensions[L];(*Iusetherowandcolumndimensionsofthematrixtomakethenewlist*)L[[row+1;;(col-row)+1]];(*Ichoosethe5x5matrixwiththe2digitvaluesandtransposeit.*)Table[ToExpression["FinalList"<>ToUpperCase[FromLetterNumber[n]]],{n,4,1,-1}];(*Icreatethenewlistnamesinreverseordertomatchthetransposedmatrix.*)Evaluate[%]=%%;(*Isetthelistnamesequaltothecorrespondinglists*)MatrixForm[Names["FinalList*"]]MatrixForm[ToExpression[Names["FinalList*"]]](*Thislineshowsthelistnamessavedcorrectly*)
"From xlsx file" |
L//MatrixForm |
Out[]=
From xlsx file | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Out[]=
FinalListA |
FinalListB |
FinalListC |
FinalListD |
a1 | a2 | a3 | a4 | a5 |
b1 | b2 | b3 | b4 | b5 |
c1 | c2 | c3 | c4 | c5 |
d1 | d2 | d3 | d4 | d5 |