[Thread Prev][Thread Next][Index]

Re: [ferret_users] Read date



Ansley Manke a écrit :
Hi Patrick,
Just for all our reference, the pieces of documentation are these: For reading Delimited files:
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/data-set-basics/ASCII-DATA#Chapter2-delimited_files

And for datatype in Ascii files:
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/SET#_VPINDEXENTRY_1617

The /TYPE=EURODATE specifier works correctly for data of the form yy-mm-dd or yyyy-mm-dd but it looks as if the form including both date and time does not. You can read your data as follows:

    yes? set dat/form=delimited/type="eurodate,time"/delim="\b" file1.txt
    yes? list v1,v2
                 DATA SET: ./file1.txt
                 X: 0.5 to 9.5
     Column  1: V1 is V1 (days)(Julian days since 1-Jan-1900)
     Column  2: V2 is V2 (hours)(Time of day)
                 V1    V2
    1   / 1:  39612.  18.26
    2   / 2:  39612.  18.59
    3   / 3:  39612.  18.92
    4   / 4:  39612.  19.25
    5   / 5:  39612.  19.57
    6   / 6:  39612.  19.90
    7   / 7:  39612.  20.23
    8   / 8:  39612.  20.56
    9   / 9:  39612.  20.89

Then you could form a variable,

    yes? let datetime = v1 + v2/24

Thank you for writing. We will at least fix up the documentation so it reflects what you can do!
Hi Ansley,
Thank you for your answer that clarifies and gives a solution.
Indeed the format yyyy-mm-dd hh:mm:ss does not work with a single type qualifier but do work
with type="eurodate,time"

Could the format yyyy/mm/dd (with '/' instead of '-') be added to the type EURODATE ?

Patrick





[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement