Re: How to EXTRACT just a numerical part of a data file ( .dat)?
- To: mathgroup at smc.vnet.net
- Subject: [mg42212] Re: How to EXTRACT just a numerical part of a data file ( .dat)?
- From: "John Jowett" <John.Jowett at cern.ch>
- Date: Mon, 23 Jun 2003 05:49:49 -0400 (EDT)
- Organization: CERN
- References: <bd2ver$1c3$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hello, Looks like you're not actually using MAD for your tracking. If you were, there is a complete structured interface to the MAD data formats. Applications include things like frequency maps. Perhaps if you look at some of our packages (particularly Mfs, TrackTable, MRFI, ..) you might getg some idea how to proceed. See http://cern.ch/jowett/Madtomma/ N.B. The Web pages are a bit messy and not up to date although the packages themselves are. Contact me if you want to know more. Otherwise, if this is a one-off unstructured application, Mathematica gives you plenty of ways to proceed. To get only the table at the end of your file, something like in=OpenRead["test.dat"]; Find[in,"dE/E"];Find[in,"dE/E"] ; data=ReadList[in,Number,RecordLists->True]; Close[in] should do the trick. John Jowett "ava" <aw247 at cornell.edu> wrote in message news:bd2ver$1c3$1 at smc.vnet.net... > I have a file that kinda look like: > Input file :freq_map.in > > beta_x = 0.427 alpha_x = 0.2705 > beta_y = 0.011 alpha_y = -0.0055 > eta_x = 0.011 eta_xp = -0.0035 > eta_y = 0.000 eta_yp = 0.0143 > ! > phase space at IP at start > phase space at IP at turn n > x xp y yp dl dE/E > turn x xp y yp dl > dE/E > 0.2000E-02 0.0000E+00 0.2000E-02 0.0000E+00 0.0000E+00 > 0.5000E-03 1 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 > 0.0000E+00 0.0000E+00 > 0.2000E-02 0.0000E+00 0.2000E-02 0.0000E+00 0.0000E+00 > 0.5000E-03 2 -0.4532E-03 0.6929E-02 -0.1514E-05 0.4522E-03 > -0.9280E-03 0.2125E-04 > ... > > I just want the columns of numbers for data analysis so that i will > have a table with columns of numbers. i don't need all the other > characters. I know i should use ReadList[], but i have no idea how to > do so. Any help would be appreciated. Thanks. >