| 1 |
/// this chunk is included by prefabs to read data.. |
| 2 |
// |
| 3 |
#if @data = "" && @inlinedata = "" |
| 4 |
#write stderr |
| 5 |
Error: either 'data' or 'inlinedata' must be specified. |
| 6 |
#endwrite |
| 7 |
#exit |
| 8 |
#endif |
| 9 |
// |
| 10 |
//// read data file.. |
| 11 |
#proc getdata |
| 12 |
#if @inlinedata != "" |
| 13 |
#set tmpfile = $tmpfilename( inline ) |
| 14 |
#write stderr |
| 15 |
#+ tmpfile is @tmpfile |
| 16 |
#endwrite |
| 17 |
#write @tmpfile |
| 18 |
#+ @inlinedata |
| 19 |
#endwrite |
| 20 |
pathname: @tmpfile |
| 21 |
#elseif @data = stdin || @data = - |
| 22 |
standardinput: yes |
| 23 |
#else |
| 24 |
// changed to use pathname - scg 5/24/05 |
| 25 |
pathname: @data |
| 26 |
#endif |
| 27 |
|
| 28 |
#ifspec delim |
| 29 |
#ifspec header fieldnameheader |
| 30 |
#ifspec comment commentchar |
| 31 |
#ifspec select |
| 32 |
#ifspec echodata showresults |
| 33 |
#ifspec nfields |
| 34 |
|
| 35 |
#if @context = chron |
| 36 |
#include $chunk_chronfilter |
| 37 |
#elseif @context = stack && @stackarea = yes && @y2 != "" |
| 38 |
#include $chunk_stackareafilter |
| 39 |
#elseif @context = vdist |
| 40 |
#include $chunk_vdistfilter |
| 41 |
#elseif @context = heatmap |
| 42 |
#include $chunk_heatmapfilter |
| 43 |
#endif |
| 44 |
|
| 45 |
#endproc |
| 46 |
|
| 47 |
#if @inlinedata != "" |
| 48 |
#shell |
| 49 |
rm -rf @tmpfile |
| 50 |
#endshell |
| 51 |
#endif |
| 52 |
|
| 53 |
#if @NRECORDS = 0 |
| 54 |
#exit |
| 55 |
#endif |
| 56 |
|
| 57 |
// #write stderr |
| 58 |
// Got @NRECORDS records, @NFIELDS fields per record. |
| 59 |
// #endwrite |
| 60 |
|