Reading numerical data from a file which also contains a text data
- To: mathgroup at smc.vnet.net
- Subject: [mg92786] Reading numerical data from a file which also contains a text data
- From: "Toshiyuki (Toshi) Meshii" <tmeshii at gmail.com>
- Date: Mon, 13 Oct 2008 06:19:18 -0400 (EDT)
Hello. I want to read numerical data from an output file, which also contains text data. The file test.t19 is as follows: id 1 =beg=50800 (Nodal Coordinates) 1 0.000000E+00 0.000000E+00 2 0.150000E+01 0.000000E+00 3 0.150000E+01 0.150000E+01 4 0.000000E+00 0.150000E+01 I want to read the coordinates of nodes 1~4. So what I did is as follows: snum = OpenRead["test.t19"] FindList[snum, "Coordinates"] ReadList[snum, Number, RecordLists -> True] The result was {{0}} ,though I expected {{1,0.000000E+00,0.000000E+00},{2,0.150000E+01,0.000000E+00},{3, 0.150000E+01,0.150000E+01},{4,0.000000E+00,0.150000E+01}} I thought that the pointer would move to the next line of the line including the word "Coordinates." Can some one help me on my problem? -Toshi