MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how to read such kind of list?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90746] Re: [mg90745] how to read such kind of list?
  • From: "Thomas Dowling" <thomasgdowling at gmail.com>
  • Date: Tue, 22 Jul 2008 06:38:30 -0400 (EDT)
  • References: <200807220758.DAA13834@smc.vnet.net>

Hello,

Although there are probably better ways, I would use Import rather than
ReadList


Something like the following ...

list = Import["/Users/..../test.txt", "Table"]


Out[45] =  {{"The", "stat", "results", "of", "Quantum", "Dots", "of",
"file",
  ":", "D:\\ProGram\\qd", "2.1.2\\1.TXT"}, {}, {"totally", 110, "QDs",
   "were", "segmented"}, {}, {"QD", "number", "per", "cm^2:",
  4.36659*10^10, "per", "cm^2"}, {"mean", "height:", 5.29252,
  "nm"}, {"mean", "diameter:", 28.8015, "nm"}, {"mean", "distance:",
  33.3098, "nm"}, {"area", "coverage:", 0.291367}, {"volume",
  "density:", 0.545079, "nm^3", "per", "nm^2"}, {"mean",
  "orientation:", 1.2718, "degree", "with", "x-axis"}, {"mean",
  "MajorAxisLength:", 28.3723, "nm"}, {"mean", "MinorAxisLength:",
  20.4584, "nm"}, {}, {"Diameter", "Height", "Area",
  "MajorAxisLength", "MinorAxisLength", "Orientation", "CentroidX",
  "CentroidY", "Volume", "Distance"}, {30.6543, 5.68231, 738.026,
  31.1171, 23.1063, -1.62224, 15.3199, 215.548, 1593.05,
  48.7416}, {26.0824, 5.76352, 534.3, 25.9359, 20.2485, -27.2306,
  10.9906, 349.057, 1109.33, 30.6338}, {16.9929, 2.05731, 226.789,
  15.9034, 11.4045, -80.5826, 5.92925, 419.607, 104.23,
  32.4718}, {33.1842, 5.23201, 864.874, 33.2583, 23.8731, 2.54486,
  33.0374, 170.141, 1416.6, 40.4787}, {34.6983, 6.37284, 945.596,
  35.0717, 25.0663, 0.415529, 35.6798, 386.624, 1878.84,
  27.9015}, {32.2872, 6.18688, 818.748, 31.8627, 23.3669, -8.17129,
  36.0545, 67.1377, 1757.76, 51.3242}}


I can then manipulate the above list.  For example,

list[[-7 ;; -1]]

Grid[%]

Or, if I just want data (no headings)

Grid@list[[-6 ;; -1]]

I use Mathematica  6.

Tom Dowling


On Tue, Jul 22, 2008 at 8:58 AM, 863 <42838879 at qq.com> wrote:

> Hi, I'm having troubles with read in such kind of list:(between the
> lines)
>
> _____________________________________________________________________________
> The stat results of Quantum Dots of file : D:\ProGram\qd 2.1.2\1.TXT
>
> totally 110 QDs were segmented
>
>  QD number per cm^2: 4.36659e+010 per cm^2
>         mean height: 5.292516 nm
>       mean diameter: 28.801531 nm
>       mean distance: 33.309811 nm
>       area coverage: 0.291367
>      volume density: 0.545079 nm^3 per nm^2
>    mean orientation: 1.271796 degree with x-axis
> mean MajorAxisLength: 28.372259 nm
> mean MinorAxisLength: 20.458377 nm
>
> Diameter        Height  Area    MajorAxisLength MinorAxisLength Orientation
> CentroidX       CentroidY       Volume  Distance
> 30.654263       5.682305        738.025950      31.117139       23.106343
>     -1.622242       15.319892
> 215.548346      1593.049175     48.741649
> 26.082407       5.763518        534.300037      25.935928       20.248467
>     -27.230550      10.990649
> 349.057494      1109.325936     30.633786
> 16.992852       2.057310        226.789224      15.903377       11.404470
>     -80.582608      5.929246
> 419.606587      104.229902      32.471795
> 33.184213       5.232010        864.874160      33.258266       23.873106
>     2.544861        33.037368
> 170.140864      1416.598341     40.478731
> 34.698269       6.372842        945.595748      35.071694       25.066265
>     0.415529        35.679808
> 386.624306      1878.842938     27.901502
> 32.287176       6.186880        818.747538      31.862749       23.366885
>     -8.171290       36.054502
> 67.137732       1757.760754     51.324165
>
> ____________________________________________________________________________________
>
>  I have dozens of such kind of lists and actually what i'm interested
> is the data not these letters.However i can't figure out by
> Read["**.txt",Number,RecordList->True]
> How to sovle this problem?
> I really appreciate your help.Thanks!
>


  • Prev by Date: NDSolve[] with nested If[] and Piecewise[] usage:
  • Next by Date: Re: Inheriting options - is there a way?
  • Previous by thread: how to read such kind of list?
  • Next by thread: Re: how to read such kind of list?