Multiple Headers in Complex Data File
- To: mathgroup at smc.vnet.net
- Subject: [mg23375] Multiple Headers in Complex Data File
- From: "Krautschik, Chris G" <krautschikc at intel.co.jp>
- Date: Fri, 5 May 2000 02:07:08 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
> Hi All, > > I need to read in a data file with multiple headers into a Data Matrix. > All header lines begin with the character "#" while the number of columns > can vary between headers. Also some numbers in the data column may be > listed as "NaN" and some data columns may contain text that can be > discarded (as long as the entire column is all text. > > I would like all the numeric data (including NaN values) to be listed in > columar format ( that is add data columns to the left of the DATA MATRIX > as the data is read in). > > Any good leads on how to best implement such a scheme in Mathematica would > be greatly appreciated. > > thanks > Chris > > Example data file below: > ----------------------------- > > # 2D/3D CD Measurement > > # > > # Format: > > #Defocus CD Slp.Asym CD-Type Meas.Thr > Meas.TypeCD-Left CD-Right CD-Center > > 0 0.14764 0 line-cd NaN image-thr 0.06591 > 0.21355 0.13973 > 0 0.1519 4.7038 line-cd 0.18 image-thr 0.07006 > 0.22196 0.14601 > 0 0.1526 0.41098 line-cd NaN image-thr 0.07087 > 0.22347 0.14717 > > # 2D/3D CD Measur > > # > > # Format: > > # Defocus CD Slp.Asym CD-Type Meas.Thr Meas.Type > CD-Left CD-Right CD-Center Meas.Type CD-Left > CD-Right CD-Center > 0 0.14925 4.8082 line-cd 0.18 image-thr 0.07045 0.2197 > 0.14508 image-thr 0.07045 0.2197 0.14508 > 0 0.15055 1.74986 line-cd 0.18 image-thr 0.07068 0.22123 > 0.14595 image-thr 0.07068 0.22123 0.14595 > 0 0.14581 2.57533 line-cd 0.18 image-thr 0.06946 0.21527 > 0.14237 image-thr 0.06946 0.21527 0.14237 > 0 0.14657 NaN line-cd 0.18 image-thr 0.06997 0.21654 > 0.14325 image-thr 0.06997 0.21654 0.14325 > 0 0.14734 4.97056 line-cd 0.18 image-thr 0.07047 0.21782 > 0.14414 image-thr 0.07047 0.21782 0.14414 > 0 0.14871 5.44819 line-cd 0.18 image-thr 0.07055 0.21926 > 0.1449 image-thr 0.07055 0.21926 0.1449 > 0 0.14998 1.44578 line-cd 0.18 image-thr 0.07084 0.22083 > 0.14584 image-thr 0.07084 0.22083 0.14584 > 0 0.15127 -0.3897 5 line-cd 0.18 image-thr 0.07131 > 0.22257 0.14694 image-thr 0.07131 0.22257 0.14694 > > # 2D/3D CD Measur > > # > > # Format: > > # Defocus CD Slp.Asym CD-Type Meas.Thr Meas.Type > CD-Left CD-Right CD-Center CD-Left > 0 0.14764 0 line-cd 0.18 image-thr 0.06591 0.21355 > 0.13973 0.06591 > 0 0.1519 4.7038 line-cd 0.18 image-thr 0.07006 0.22196 > 0.14601 0.07006 > 0 0.1526 0.41098 line-cd 0.18 image-thr 0.07087 0.22347 > 0.14717 0.07087 > 0 0.1482 4.78709 line-cd 0.18 image-thr 0.07079 0.21899 > 0.14489 0.07079