= #JxnPortable/docs/application_examples/TimeStamp.jxn

src = @JxnRealArrayTextFileDataSource $this.getPath "data_with_timestamp.html"
 = "data_with_timestamp.html", 0, ";\t", " " (JxnRealArrayTextFileDataSource)
format src.readLines 6
 = {     12345678901234567890123456789012345678901234567890123456789012345678901234567890,
 =   1: "<pre>",
 =   2: "file: data_with_timestamp.html",
 =   3: "",
 =   4: "Date     Time\tTemperature_[C]\tRadiation_[W/m2]",
 =   5: "20050321 0000\t-1\t0",
 =   6: "20050321 0015\t-1.3\t0" } (java.lang.String[7]) (java.lang.String)
!
t = src.get( 1, @SimpleDateFormat("yyyyMMdd HHmm") )
 = {21.03.2005 00:00:00 MEZ, 21.03.2005 00:15:00 MEZ ... 28.03.2005 00:00:00 MESZ "Date     Time	Temperature_[C]	Radiation_[W/m2]"}[673] (JxnRealArrayAlgebra)
! As ' ' is a delimiter, Date and Time count as two columns and tmp is read from column 3:
tmp = src[3]
 = {-1.0, -1.3 ... 9.9 "Temperature_[C]"}[673] (JxnRealArrayAlgebra)
rad = src[4]
 = {0.0, 0.0 ... 0.0 "Radiation_[W/m2]"}[673] (JxnRealArrayAlgebra)
plot( t, rad/25, tmp ).setPlotFrameTitle( "red: Radiation/25 [W/m²], blue: Temperature [°C]" )
 = null
!
! now read the same file after changing the default date time format and the 2nd delimiter:
src.setDateTimeFormat( "yyyyMMdd HHmm" ).setDelimiters( null, "" )  ! null => no change
 = "data_with_timestamp.html", 0, ";\t", "" (JxnRealArrayTextFileDataSource)
t = src[-1]  ! < 0 reads date time values from 1st column
 = {21.03.2005 00:00:00 MEZ, 21.03.2005 00:15:00 MEZ ... 28.03.2005 00:00:00 MESZ "Date     Time	Temperature_[C]	Radiation_[W/m2]"}[673] (JxnRealArrayAlgebra)
tmp = src[2]  ! with removed ' ' delimiter now from column 2
 = {-1.0, -1.3 ... 9.9 "Temperature_[C]"}[673] (JxnRealArrayAlgebra)
rad = src[3]
 = {0.0, 0.0 ... 0.0 "Radiation_[W/m2]"}[673] (JxnRealArrayAlgebra)
plot( t, rad/25, tmp ).setPlotFrameTitle( "red: Radiation/25 [W/m²], blue: Temperature [°C]" )
 = null