|
From: Ethan M. <merritt@u.washington.edu> - 2010-03-28 00:35:36
|
On Saturday 27 March 2010, pl...@pi... wrote: > Hi, > > I have an additional problem/suggestion relating to a similar set of data > > F-00238 378 700323-700330 511.0 -28.8 516.6 11 > > the date (range) is contained in $3 this one being 23rd March 1970 - > 30th March 1970 > > Unless I have missed a trick it does not seem possible to read this in > with gnuplot (more awking required?) I have never figured out how to use gnuplot's builtin time/date routines effectively. I suggest you read in the relevant field of the input file as a string or a pure integer and do the date formatting yourself using strptime()/strftime(). > What would be useful is a dead text specifier. The useful data matches > %y%m%d but I can't tell it to ignore the rest. > > A new specifier like %i to ignore the rest of the string would be useful > (and easy to add ). > > "%y%m%d-%i" > > Have I missed an easy way to handle this? See above. Read it as a string and chop it into the pieces you need. mystartdate(i) = strcol(i)[5:6]."-".strcol(i)[3:4]."-19".strcol(i)[1:2] plot foo using (mystartdate(3)): .... will turn your 700323-700330 into "23-03-1970", which you can now do with whatever you like. Of course this particular function forces all your dates into C20. You'd need a more complicated function to match a different convention of input dates. Ethan Ethan |