View Single Post
Old 05-04-2005, 12:44 PM  
jeza
Senior Member
 
jeza's Avatar
 
Join Date: May 2003
Posts: 530
Default

Code:

set time_now		[clock seconds]
set time_formated	[clock format $time_now -format {%Y-%m-%d %H:%M:%S} -gmt true]
set file_time		""
set file_formated	""

if { [file exist "x:/path/file"] } {

  set reply [open "x:/path/file" "r+"]
  
  while {![eof $reply]} {
    
    set line [gets $reply]
    
    if { [regexp -nocase -- {[0-9]{1,4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}} $line out] } {
      
      set file_time		$out
      set file_formated		[clock scan "$out" -gmt true]
      
      iputs -nobuffer "time_now......: $time_now"
      iputs -nobuffer "time_formated.: $time_formated"
      iputs -nobuffer "line..........: $line"
      iputs -nobuffer "file_time.....: $file_time"
      iputs -nobuffer "file_formated.: $file_formated"
      
      
    }
    
  }
  
  close $reply
  
}
jeza is offline   Reply With Quote