Array help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Davide

    Array help

    I all!!

    I never use array and I'm loosing in documentation..
    I have got this result

    ---start---
    ds0 ds1

    1116577800: 4.9947045401e+0 6 1.8617100885e+0 5
    1116579600: 5.6350684561e+0 6 2.0436081850e+0 5
    1116581400: 5.6629472702e+0 6 2.3664823803e+0 5
    ---end----

    I would like to have only this value:

    $ds0 = 4.9947045401e+0 6
    $ds1 = 1.8617100885e+0 5

    for each line
    thanx really :)

  • Ken Robinson

    #2
    Re: Array help

    Davide wrote:[color=blue]
    >
    > ---start---
    > ds0 ds1
    >
    > 1116577800: 4.9947045401e+0 6 1.8617100885e+0 5
    > 1116579600: 5.6350684561e+0 6 2.0436081850e+0 5
    > 1116581400: 5.6629472702e+0 6 2.3664823803e+0 5
    > ---end----
    >
    > I would like to have only this value:
    >
    > $ds0 = 4.9947045401e+0 6
    > $ds1 = 1.8617100885e+0 5
    >
    > for each line[/color]

    How did you generate this result? Code?

    Ken

    Comment

    • Davide

      #3
      Re: Array help

      using rrdtool
      RRDtool is the OpenSource industry standard, high performance data logging and graphing system for time series data. RRDtool can be easily integrated in shell scripts, perl, python, ruby, lua or tcl applications.

      :)

      Comment

      • Geoff Berrow

        #4
        Re: Array help

        I noticed that Message-ID:
        <1116959517.302 776.64650@g47g2 000cwa.googlegr oups.com> from Davide
        contained the following:
        [color=blue]
        >---start---
        > ds0 ds1
        >
        >1116577800: 4.9947045401e+0 6 1.8617100885e+0 5
        >1116579600: 5.6350684561e+0 6 2.0436081850e+0 5
        >1116581400: 5.6629472702e+0 6 2.3664823803e+0 5
        >---end----
        >
        >I would like to have only this value:
        >
        >$ds0 = 4.9947045401e+0 6
        >$ds1 = 1.8617100885e+0 5[/color]

        Use explode() on each line, spitting on the space. The items you need
        will be the second and third elements of the resultant arrays.

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        • Davide

          #5
          Re: Array help

          Hi,

          This is correct, and I guess about it but I cannot understand how to
          exclude these 2 initial rows:

          line1 ds0 ds1
          line2

          Cheers

          Comment

          • Davide

            #6
            Re: Array help

            Hi,

            This is correct, and I guess about it but I cannot understand how to
            exclude these 2 initial rows:

            line1 ds0 ds1
            line2

            Cheers

            Comment

            • Davide

              #7
              Re: Array help

              Hi,

              This is correct, and I guess about it but I cannot understand how to
              exclude these 2 initial rows:

              line1 ds0 ds1
              line2

              Cheers

              Comment

              Working...