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: [mg90774] Re: how to read such kind of list?
  • From: 863 <42838879 at qq.com>
  • Date: Wed, 23 Jul 2008 06:00:29 -0400 (EDT)
  • References: <200807220758.DAA13834@smc.vnet.net> <g64dc9$i49$1@smc.vnet.net>

Hi, Tom,
I  tried: ReadList["**.txt",Word] and "Partition" to get sublists.
Obviously, yours is the best way.
Pity there is no such command "Grid" in V.5.0 I use, but i can figure
it out
thanks for your help


On 7=D4=C222=C8=D5, =CF=C2=CE=E76=CA=B139=B7=D6, "Thomas Dowling" <thomasgd=
owl... at gmail.com> wrote:
> 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
>
>


  • Prev by Date: Re: 3D Graphics are too slow.
  • Next by Date: Re: export eps
  • Previous by thread: Re: how to read such kind of list?
  • Next by thread: NDSolve[] with nested If[] and Piecewise[] usage: