How to plot a date file? Some questions, some solutions.
- To: mathgroup at smc.vnet.net
- Subject: [mg4848] How to plot a date file? Some questions, some solutions.
- From: lbliao at alumnae.caltech.edu (lbliao)
- Date: Thu, 26 Sep 1996 22:42:12 -0400
- Organization: California Institute of Technology, Alumni Association
- Sender: owner-wri-mathgroup at wolfram.com
The following is a file that I want to plot as either R versus FQ or DG versus FQ. Note it has three columns of numbers preceeded by two letter identifiers R_, DG, FQ, where R_ is a two letter identifier. _ denotes white space. R 999.1E-3,DG 000.0E+0,FQ 1.000E+3 R 999.1E-3,DG 000.0E+0,FQ 1.023E+3 R 999.1E-3,DG 000.0E+0,FQ 1.047E+3 R 999.1E-3,DG 000.0E+0,FQ 1.072E+3 R 999.1E-3,DG 000.0E+0,FQ 1.096E+3 R 999.1E-3,DG 000.0E+0,FQ 1.122E+3 R 999.1E-3,DG 000.0E+0,FQ 1.148E+3 R 999.1E-3,DG 000.0E+0,FQ 1.175E+3 R 999.1E-3,DG 000.0E+0,FQ 1.202E+3 R 999.1E-3,DG 000.0E+0,FQ 1.230E+3 R 998.9E-3,DG 000.0E+0,FQ 7.244E+3 R 998.9E-3,DG 000.0E+0,FQ 7.413E+3 R 999.0E-3,DG 000.0E+0,FQ 7.585E+3 R 998.9E-3,DG 000.0E+0,FQ 7.762E+3 R 998.9E-3,DG 000.0E+0,FQ 7.943E+3 R 998.9E-3,DG 000.0E+0,FQ 8.128E+3 R 999.0E-3,DG 000.0E+0,FQ 8.317E+3 R 999.0E-3,DG 000.0E+0,FQ 8.511E+3 R 999.0E-3,DG 000.0E+0,FQ 8.709E+3 R 999.0E-3,DG 000.0E+0,FQ 8.912E+3 R 999.0E-3,DG 000.0E+0,FQ 9.120E+3 R 999.0E-3,DG 000.0E+0,FQ 9.332E+3 R 998.8E-3,DG-000.0E+0,FQ 9.999E+3 R 998.8E-3,DG-000.0E+0,FQ 10.00E+3 The format is consistent. There is no space between a two letter identifier and the number. R followed by a space, then an optional sign, ie - for minus or space for plus. The number part is 4 digit and one decimal sign. The Exponent is one digit with a mandatory sign, then a comma separator, and next two letter identifier DG, followed by no space and so on. The first problem is to separate the list into three columns and ignoring R ,DG ,FQ This is done by the following ReadList command. a=ReadList["c:\\file", Word, WordSeparators -> {"R", ",DG", ",FQ"}, RecordLists->True] For RecordList -> True, see page 182, For WordSeparators -> {}, see p 496, This has one PROBLEM. Although all the three number fields are separated, they are not numbers any more, but words. The second problem is to get any two columns from the three columns so that they can be plotted using PlotList command. I do not see how to directly get two columns other than transposing getting the rows, and then transposing back again, ie Transpose[Transpose[a][[{1,3}]]] Can some kind soul help? Pls reply via email also. Thanks a lot! lbliao ==== [MESSAGE SEPARATOR] ====