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$
7
  • 1
    $\begingroup$ Perhaps you can add a link to the data? Or a relevant subset of it. $\endgroup$
    – FredrikD
    Aug 4, 2017 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, 2017 at 9:24
  • $\begingroup$ @FredikD can you tell me more about how to get that link work? Thanks $\endgroup$
    – pablo
    Aug 4, 2017 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, 2017 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, 2017 at 10:08

0

Browse other questions tagged or ask your own question.