1
$\begingroup$

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

$\endgroup$

closed as off-topic by m_goldberg, MarcoB, LCarvalho, J. M. will be back soon Aug 5 '17 at 16:51

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, MarcoB, LCarvalho, J. M. will be back soon
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Perhaps you can add a link to the data? Or a relevant subset of it. $\endgroup$ – FredrikD Aug 4 '17 at 9:11
  • $\begingroup$ @Kuba I know the best way is to import as a String but if I use "String" instead "Data" in the Import[] it does not work. After the import as "Data" ToString[]does not work either. $\endgroup$ – pablo Aug 4 '17 at 9:24
  • $\begingroup$ @FredikD can you tell me more about how to get that link work? Thanks $\endgroup$ – pablo Aug 4 '17 at 9:26
  • $\begingroup$ @Kuba Yes, the problem is that when I import the data Mathematica keeps all into a List, {[[2 3 4 5 6] [.....]]....]]}. $\endgroup$ – pablo Aug 4 '17 at 9:49
  • $\begingroup$ If 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$ – LouisB Aug 4 '17 at 10:08