I'm trying to import some data in a .txt file which contains numbers and words. I import a list which consists of four rows of measured data acquired with an oscilloscope, but the acquisition program puts units in every measured value. Here's an example:
data={{-1.1000u s,-120.00m V,-1.1000u s,8.0000 V},
{-1.0800u s,-120.00m V,-1.0800u s,8.0000 V},
{-60.000n s,-40.000m V,-60.000n s,8.0000 V},
{-40.000n s,-40.000m V,-40.000n s,8.0000 V},
{-20.000n s,-32.000m V,-20.000n s,8.0000 V},
{0.0000 s,-32.000m V,0.0000 s,8.0000 V}}
I would like to know if there's any way I can turn the above list into something more like this:
newdata={{-1.1000,-0.12000,-1.1000,8.0000},
{-0.060000,-0.040000,-0.060000,8.0000},
{-0.040000,-0.040.000,-0.040000,8.0000},
{-0.020000,-0.032000,-0.020.000,8.0000},
{0.0000,-0.032000,0.0000,8.0000}}
I'll appreciate any ideas. Thanks.
Map[First[Cases[{#}, _?NumericQ, Infinity]] &, data, {2}]
. $\endgroup$u
,s
, etc strings or symbols? $\endgroup$