Name of a list
- To: mathgroup at smc.vnet.net
- Subject: [mg26619] Name of a list
- From: "news.clara.net" <j.k.jones at dl.ac.uk>
- Date: Sat, 13 Jan 2001 22:36:03 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Could someone provide some help with a small problem I have?? I have a list of formatted data with a title. This list is made up of other elements seperately defined. I need to output, to a seperate file, the element data from the list in a formatted way, on seperate lines. Then I need to define the list in terms of the names of the elements within it and its title. Currently I apply the element name as part of the list and read it out when needed, as the elements aren't defined as variables, just elements in a seperate list. However, how do I then print a line with the list title and then the element names? Obviously the element names are read from the list individually, but the list name is a variable representing the list. I can't specify the list name as a seperate variable as it is representative of a list, and it is very unwieldy to have to define a list in terms of elements and call it something, and then rename it when it is written to a file. The crux of my question is, can you take the name of a list and output it as a string?? For reference, the list would like: SRS = {{"quad1", Quadrupole, 1.2, -2.9, "---", "---", "qd"}, {"sb1", SectorBend, 3.6, 0.007, "---", 2, "bend"}, {"bpm1", BPM, 0, "---", "---", "---", "bpm"}} and the file text should look like: SRS: Line = quad1, sb1, bpm1 Any help would be much appreciated, James Jones Daresbury Lab. j.k.jones at dl.ac.uk