ReportNode2.txt is a Text File used for report data. The script first runs a Test if the file exists. if not, create it with header lines, then enter a row of time stamped data.
# Txtcreate.scr
# ReportNode2.txt is a Text File used for report data
# Test if ReportNode2.txt files exists,
# enter a row of time stamped data
# if not, create it with header lines
if {[file exists "ReportNode2.txt"]} then {
set fileid [open "ReportNode2.txt" a+]
puts $fileid "[GETVAL %TTMDATE] [GETVAL %TTMTIME] [GETVAL AMPLITUDE] [GETVAL TIMER] "
close $fileid
} else {
set fileid [open "ReportNode2.txt" a+]
seek $fileid 0 start
puts $fileid "----- Water Use Report-------\nPage 1"
#Insert data into table
puts $fileid "[GETVAL %TTMDATE] [GETVAL %TTMTIME] [GETVAL AMPLITUDE] [GETVAL TIMER] "
close $fileid
}