% % Raw data summary per day, place csv section in directed area % % stack: params % % Tab|Area|Dated|Direction|Drive|Days|Segments|Detail|t9life|t10life|t11life|t12life|analyzed % "|" 0 13 1 parse !Raw.Analyzed !Raw.T12life !Raw.T11life !Raw.T10life !Raw.T9life !Raw.Detail !Raw.Segments !Raw.Days !Raw.Drive !Raw.Direction !Raw.Dated !Raw.Area !Raw.Tab % % establish source folder for data points % _Raw.Drive &":\inetpub\wwwroot\Up\" &_Raw.Tab &"\" !Raw.Folder % % set the low limit of date to retrieve % Time.Now Time.Datels pop ^"/" & &"/" ^ _Raw.Analyzed "True" eq$ { 1 } { _Raw.Days + } ifelse minus "d" Time.Add !Raw.Least _Raw.Least shdate &"_" "rawseed" log)( !Raw.Seed % % get data from selected drive % start with empty builder or all records if analyzed alread % _Raw.Analyzed "True" eq$ { "_rawsun" text_conn } { % % reset the all-but-today builder summary % empty "_rawsun" text!conn empty } ifelse !builder % % prior days date diff with least date, in days % 0 !bulday % % prior days value of Tcount first encountered % 0 !buldtcnt % % prior days most recently analyzed Tcount % 0 !pcount 0 !Telm.T9 0 !Telm.T10 0 !Telm.T11 0 !Telm.T12 % % initialize prior days date with least date % _Raw.Least !xdate % % prior days csv detail summary collector % empty !xubuld % % zero out the daily summary % *gwizsumz _Raw.Least !ldate "??????_" textwild _Raw.Folder _Raw.Seed { nextfile ? % % is the next data point valid % *gwizqcnt { % % valid data point, groom the data point actual time of collection % the time and date supplied by machine is probably off % filing stamp _ldate second "s" Time.Diff dup unwhole { "offdate " &4 log)( } if pop !ldate % % use first Tcount if not yet init % _pcount zero { _Telm.Tcount !pcount } if % % load the csv for the data point % *gwizxcsv *gwizsumt } if } loop filing) % % summarize the current date by processing with tomorrow's date % no summary for tomorrow will appear % _ldate Time.Now "d" Time.Diff zero { % % this is today's summary last processed % save the all-but-today builder summary % _builder "_rawsun" text!conn } { % % today was not last date processed % } ifelse Time.Now 1 "d" Time.Add !ldate *gwizsumt % % write the raw summary list % _builder "_rawsum" text!conn "_rawsum" conntext % % load the list of dates/qty in current worksheet % _Raw.Area "Summed" @Xls @^xlRunF2