I have imported a set of rows from a column of an Excel sheet as follows:
datFPS = Import["gis-cc13 s-fps-200solx24sim-table.xlsx", {"Data", 1,
Range[8, 31], 18}];
The problem is the format of datFPS
is:
{[[94 76 7 4 1] [3 1 5 98 100] ...]] [[23 22 11 45 7]...]]...]]}
This is several blocks of 5 numbers, all into [
and ]
corresponding to each row of the excel. If I do
Head[datFPS] = List
but I would like a common list of Mathematica which would be
{{94,76,7,4,1},{3,1,5,98,100}, {...},...{...}}
If datFPS
was a String
probably I could make StringReplace[]
but is not the case.
Is there any way of converting datFPS
to a list with braces and with comma separations?.
Thank you very much for your help
Regards
"String"
instead"Data"
in theImport[]
it does not work. After the import as "Data"ToString[]
does not work either. $\endgroup$List
,{[[2 3 4 5 6] [.....]]....]]}
. $\endgroup$Import
is giving you a list that contains a single string, like this,s = {"[[94 76 7 4 1][3 1 5 98 100]]"}
, then you may be able to convert the string using a command like this:StringReplace[ First@s, {"][" -> "},{", "[" -> "{", "]" -> "}", " " -> ","}] // ToExpression
$\endgroup$