Ребята, вышло!
Код:
In[430]:= h1 = Import["C:\\1.txt", "String"]
Out[430]= "% Model: 1.mph
% Version: COMSOL 4.4.0.150
% Date: Jul 1 2014, 12:36
% Table: Table 6 - Line Average 1 (emw.Hz)
% freq Magnetic field, z \
component (A/m)
2.5E14 \
-0.003662239310465777-4.05264920233293E-4i
2.51E14 \
-0.003769916226571995-2.2145684579596164E-4i
2.52E14 \
-0.0038433889431836424-2.1631262077027855E-5i
2.53E14 \
-0.003881062128518195+1.8783739515669515E-4i
2.54E14 \
-0.00388250522422471+4.0061534949025753E-4i
2.55E14 \
-0.0038483662891500656+6.106092250516684E-4i
2.56E14 \
-0.003780257529840293+8.121319574146916E-4i
2.57E14 \
-0.0036806223896576444+0.001000033393841302i
2.58E14 \
-0.0035525929565530206+0.0011697963733597594i
2.59E14 \
-0.003399845006246796+0.0013176007358062021i"
In[431]:= h2 = StringDrop[h1, 247];
In[433]:= h3 = StringReplace[h2, {"E" -> "*10^", "i" -> " I"}]
Out[433]= "2.5*10^14 \
-0.003662239310465777-4.05264920233293*10^-4 I
2.51*10^14 \
-0.003769916226571995-2.2145684579596164*10^-4 I
2.52*10^14 \
-0.0038433889431836424-2.1631262077027855*10^-5 I
2.53*10^14 \
-0.003881062128518195+1.8783739515669515*10^-4 I
2.54*10^14 \
-0.00388250522422471+4.0061534949025753*10^-4 I
2.55*10^14 \
-0.0038483662891500656+6.106092250516684*10^-4 I
2.56*10^14 \
-0.003780257529840293+8.121319574146916*10^-4 I
2.57*10^14 \
-0.0036806223896576444+0.001000033393841302 I
2.58*10^14 \
-0.0035525929565530206+0.0011697963733597594 I
2.59*10^14 \
-0.003399845006246796+0.0013176007358062021 I"
Но как теперь мне обратно в виде таблице перевести?
Чтобы было вот так:
Код:
In[435]:= h4 = Import["C:\\1.txt", "Table"]
Out[435]= {{"%", "Model:", "1.mph"}, {"%", "Version:", "COMSOL",
"4.4.0.150"}, {"%", "Date:", "Jul", 1, "2014,", "12:36"}, {"%",
"Table:", "Table", 6, "-", "Line", "Average", 1, "(emw.Hz)"}, {"%",
"freq", "Magnetic", "field,", "z", "component",
"(A/m)"}, {2.5*10^14,
"-0.003662239310465777-4.05264920233293E-4i"}, {2.51*10^14,
"-0.003769916226571995-2.2145684579596164E-4i"}, {2.52*10^14,
"-0.0038433889431836424-2.1631262077027855E-5i"}, {2.53*10^14,
"-0.003881062128518195+1.8783739515669515E-4i"}, {2.54*10^14,
"-0.00388250522422471+4.0061534949025753E-4i"}, {2.55*10^14,
"-0.0038483662891500656+6.106092250516684E-4i"}, {2.56*10^14,
"-0.003780257529840293+8.121319574146916E-4i"}, {2.57*10^14,
"-0.0036806223896576444+0.001000033393841302i"}, {2.58*10^14,
"-0.0035525929565530206+0.0011697963733597594i"}, {2.59*10^14,
"-0.003399845006246796+0.0013176007358062021i"}}