Loading ...
Sorry, an error occurred while loading the content.

date.time ??

Expand Messages
  • jbw_yes
    I have a data file I am reading in and the lines look like this: 01/29/02 , 16:05 , 68.64, 205.920, 13.06, 55.58, 01/29/02 , 16:10 , 71.19, 212.858,
    Message 1 of 3 , Jan 31, 2002
    • 0 Attachment
      I have a data file I am reading in and the lines look like this:

      "01/29/02","16:05", 68.64, 205.920, 13.06, 55.58,
      "01/29/02","16:10", 71.19, 212.858, 12.92, 58.27,

      I want to be able to do be able to graph more then one day. To do
      this I need to get the date and time in the date.time format. I have
      read and tried all the things I can find to do this with the filter:
      but I must be doing some thing wrong.

      Here is a script that works for one day but I don't know how to make
      it join the date and time with a period and use it to graph the data
      for more then one day.

      This works for one day:

      #proc page
      #if @DEVICE in png,gif
      scale: 0.8
      #endif

      #proc getdata
      delim: comma
      file: cpu.csv
      fieldnames: date time cpu

      #proc areadef
      title: % CPU Utilization
      titledetails: size=14 align=C
      rectangle: 1 1 8 4
      xscaletype: time hh:mm
      xrange: 00:00 23:59
      yrange: 0 100

      #proc xaxis
      stubs: inc 2 hours
      minorticinc: 30 minutes
      stubformat: hhA

      #proc yaxis
      stubs: inc 10
      gridskip: min
      ticincrement: 100 1000

      #proc curvefit
      xfield: time
      yfield: cpu
      linedetails: color=blue width=.5
      legendlabel: cpu

      #proc legend
      location: max-1 max
      seglen: 0.2


      - Justin
    • Stephen C. Grubb
      Justin, The first problem is that your data isn t truly comma delimited; there is also whitespace between fields. In order to use delim: comma your data needs
      Message 2 of 3 , Feb 1, 2002
      • 0 Attachment
        Justin,

        The first problem is that your data isn't truly comma delimited; there is
        also whitespace between fields. In order to use delim: comma your data
        needs to look like this:

        "01/29/02","16:05",68.64,205.920,13.06,55.58,
        "01/29/02","16:10",71.19,212.858,12.92,58.27,
        "01/30/02","16:05",68.64,205.920,13.06,55.58,
        "01/30/02","16:10",71.19,212.858,12.92,58.27,
        "01/31/02","16:05",68.64,205.920,13.06,55.58,
        "01/31/02","16:10",71.19,212.858,12.92,58.27,

        It's often useful to use getdata showresults: yes to see what you have
        read & parsed, when developing & debugging.

        Once your data has been cleaned up, the following script should do the
        trick.. It uses a filter to combine the date & time fields. Keep in mind
        that the filter result needs to use the same delimitation method as the
        input (comma in this case; quotes don't matter). -Steve

        #proc getdata
        showresults: yes
        delim: comma
        file: cpu.csv
        filter:
        ##set DT = @@1.@@2
        ##print @DT,@@3

        // set fieldnames (post-filter)..
        fieldnames: dt cpu

        #proc areadef
        title: % CPU Utilization
        titledetails: size=14 align=C
        rectangle: 1 1 8 4
        xscaletype: datetime mm/dd/yy.hh:mm
        xautorange: datafield=dt
        //xrange: 01/28/02.00:00 02/01/02.00:00
        yrange: 0 100

        #proc xaxis
        stubs: inc 12 hours
        minorticinc: 30 minutes
        stubformat: MMMdd.hhA

        #proc yaxis
        stubs: inc 10
        gridskip: min
        ticincrement: 100 1000

        #proc curvefit
        // xfield: time
        xfield: dt
        yfield: cpu
        linedetails: color=blue width=.5
        legendlabel: cpu

        #proc legend
        location: max-1 max
        seglen: 0.2

        ----------------

        On Thu, 31 Jan 2002, jbw_yes wrote:

        >
        > I have a data file I am reading in and the lines look like this:
        >
        > "01/29/02","16:05", 68.64, 205.920, 13.06, 55.58,
        > "01/29/02","16:10", 71.19, 212.858, 12.92, 58.27,
        >
        > I want to be able to do be able to graph more then one day. To do
        > this I need to get the date and time in the date.time format. I have
        > read and tried all the things I can find to do this with the filter:
        > but I must be doing some thing wrong.
        >
        > Here is a script that works for one day but I don't know how to make
        > it join the date and time with a period and use it to graph the data
        > for more then one day.
        >
        > This works for one day:
        >
        > #proc page
        > #if @DEVICE in png,gif
        > scale: 0.8
        > #endif
        >
        > #proc getdata
        > delim: comma
        > file: cpu.csv
        > fieldnames: date time cpu
        >
        > #proc areadef
        > title: % CPU Utilization
        > titledetails: size=14 align=C
        > rectangle: 1 1 8 4
        > xscaletype: time hh:mm
        > xrange: 00:00 23:59
        > yrange: 0 100
        >
        > #proc xaxis
        > stubs: inc 2 hours
        > minorticinc: 30 minutes
        > stubformat: hhA
        >
        > #proc yaxis
        > stubs: inc 10
        > gridskip: min
        > ticincrement: 100 1000
        >
        > #proc curvefit
        > xfield: time
        > yfield: cpu
        > linedetails: color=blue width=.5
        > legendlabel: cpu
        >
        > #proc legend
        > location: max-1 max
        > seglen: 0.2
        >
        >
        > - Justin
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > ploticus-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
        >


        Stephen C. Grubb scg@...
        Scientific Software Engineer, The Jackson Laboratory
        600 Main Street Bar Harbor, Maine 04609 USA
      • jbw_yes
        Stephen, Cool! That s just what I needed. I understand how it works not but I was not sure about one part of it and that messed me up. Thanks again! - Justin
        Message 3 of 3 , Feb 1, 2002
        • 0 Attachment
          Stephen,

          Cool! That's just what I needed. I understand how it works not but I
          was not sure about one part of it and that messed me up.

          Thanks again!

          - Justin

          --- In ploticus@y..., "Stephen C. Grubb" <scg@j...> wrote:
          > Justin,
          >
          > The first problem is that your data isn't truly comma delimited;
          there is
          > also whitespace between fields. In order to use delim: comma your
          data
          > needs to look like this:
          >
          > "01/29/02","16:05",68.64,205.920,13.06,55.58,
          > "01/29/02","16:10",71.19,212.858,12.92,58.27,
          > "01/30/02","16:05",68.64,205.920,13.06,55.58,
          > "01/30/02","16:10",71.19,212.858,12.92,58.27,
          > "01/31/02","16:05",68.64,205.920,13.06,55.58,
          > "01/31/02","16:10",71.19,212.858,12.92,58.27,
          >
          > It's often useful to use getdata showresults: yes to see what you
          have
          > read & parsed, when developing & debugging.
          >
          > Once your data has been cleaned up, the following script should do
          the
          > trick.. It uses a filter to combine the date & time fields. Keep
          in mind
          > that the filter result needs to use the same delimitation method as
          the
          > input (comma in this case; quotes don't matter). -Steve
          >
          > #proc getdata
          > showresults: yes
          > delim: comma
          > file: cpu.csv
          > filter:
          > ##set DT = @@1.@@2
          > ##print @DT,@@3
          >
          > // set fieldnames (post-filter)..
          > fieldnames: dt cpu
          >
          > #proc areadef
          > title: % CPU Utilization
          > titledetails: size=14 align=C
          > rectangle: 1 1 8 4
          > xscaletype: datetime mm/dd/yy.hh:mm
          > xautorange: datafield=dt
          > //xrange: 01/28/02.00:00 02/01/02.00:00
          > yrange: 0 100
          >
          > #proc xaxis
          > stubs: inc 12 hours
          > minorticinc: 30 minutes
          > stubformat: MMMdd.hhA
          >
          > #proc yaxis
          > stubs: inc 10
          > gridskip: min
          > ticincrement: 100 1000
          >
          > #proc curvefit
          > // xfield: time
          > xfield: dt
          > yfield: cpu
          > linedetails: color=blue width=.5
          > legendlabel: cpu
          >
          > #proc legend
          > location: max-1 max
          > seglen: 0.2
          >
          > ----------------
          >
          > On Thu, 31 Jan 2002, jbw_yes wrote:
          >
          > >
          > > I have a data file I am reading in and the lines look like this:
          > >
          > > "01/29/02","16:05", 68.64, 205.920, 13.06, 55.58,
          > > "01/29/02","16:10", 71.19, 212.858, 12.92, 58.27,
          > >
          > > I want to be able to do be able to graph more then one day. To do
          > > this I need to get the date and time in the date.time format. I
          have
          > > read and tried all the things I can find to do this with the
          filter:
          > > but I must be doing some thing wrong.
          > >
          > > Here is a script that works for one day but I don't know how to
          make
          > > it join the date and time with a period and use it to graph the
          data
          > > for more then one day.
          > >
          > > This works for one day:
          > >
          > > #proc page
          > > #if @DEVICE in png,gif
          > > scale: 0.8
          > > #endif
          > >
          > > #proc getdata
          > > delim: comma
          > > file: cpu.csv
          > > fieldnames: date time cpu
          > >
          > > #proc areadef
          > > title: % CPU Utilization
          > > titledetails: size=14 align=C
          > > rectangle: 1 1 8 4
          > > xscaletype: time hh:mm
          > > xrange: 00:00 23:59
          > > yrange: 0 100
          > >
          > > #proc xaxis
          > > stubs: inc 2 hours
          > > minorticinc: 30 minutes
          > > stubformat: hhA
          > >
          > > #proc yaxis
          > > stubs: inc 10
          > > gridskip: min
          > > ticincrement: 100 1000
          > >
          > > #proc curvefit
          > > xfield: time
          > > yfield: cpu
          > > linedetails: color=blue width=.5
          > > legendlabel: cpu
          > >
          > > #proc legend
          > > location: max-1 max
          > > seglen: 0.2
          > >
          > >
          > > - Justin
          > >
          > >
          > >
          > > To unsubscribe from this group, send an email to:
          > > ploticus-unsubscribe@y...
          > >
          > >
          > >
          > > Your use of Yahoo! Groups is subject to
          http://docs.yahoo.com/info/terms/
          > >
          > >
          > >
          >
          >
          > Stephen C. Grubb scg@j...
          > Scientific Software Engineer, The Jackson Laboratory
          > 600 Main Street Bar Harbor, Maine 04609 USA
        Your message has been successfully submitted and would be delivered to recipients shortly.