Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

RE: Nested Lists

  • To: mathgroup at
  • Subject: [mg28392] RE: [mg28373] Nested Lists
  • From: "tgarza01 at" <tgarza01 at>
  • Date: Sun, 15 Apr 2001 00:13:44 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

This is a good exercise on list manipulation. Suppose your data  in an Excel file (call it ptest.txt, for example) is as follows:


i.e. a time-stamp and a set of (in this example) 4 3D points. You read them in with

    Number, RecordLists->True];

This will take the fourth reading in each time-stamp:


Tomas Garza
Mexico City

Original Message:
From:  rlove at (Robert Love)
To: mathgroup at
Subject: [mg28392] [mg28373] Nested Lists

I'm confused about nested lists and how to select/extract data from them.

I have a file of data I can use ReadList to read.  The data is laid out
like this:

x y z
x y z
x y z
x y z
x y z
x y z
x y z
x y z

The data consists of a timestamp on a line and then the 3D position of 
each of the N objects for that time.  N is always the same number
so I read it it like this:

ReadList["file",{Number, Table[Number, Number, Number,{N}]}]

I'm doing this from memory since the computer w/Mathematica is at work.
So I may not have every  detail of the ReadList correct but what I end up
with is


My question is now  do I extract this  suitable for graphing, that is, how
do I turn this into something like a set of all the object #4 positions
along with the time?  I'm sure there is some combination of Flatten, Take,
Transpose and Map that  will do what I want.  What is it?  Also, is there
a better way to use  ReadList?  I'm stuck with the file format but I can
change how I read the data.

All advice appreciated. 

Bob Love

Mail2Web - Check your email from the web at .

  • Prev by Date: Re: how applicate a function to a list??
  • Next by Date: RE: Nested Lists
  • Previous by thread: Re: Nested Lists
  • Next by thread: RE: Nested Lists