1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
{%macro display_csv_fields()%}
<div class="border rounded p-3 mb-3"
role="group"
aria-labelledby="file-inputs-group-label">
<div id="file-inputs-group-label" class="fw-bold mb-2">CSV Details</div>
<div class="form-group">
<div class="row mb-3">
<label for="txt-file-separator" class="col-sm-3 col-form-label">
File Separator</label>
<div class="col-sm-9">
<div class="input-group">
<input id="txt-file-separator"
name="file-separator"
type="text"
value="	"
class="form-control"
maxlength="1" />
<span class="input-group-btn">
<button id="btn-reset-file-separator" class="btn btn-info">Reset Default</button>
</span>
</div>
</div>
<span class="form-text text-muted">
Provide the character that separates the fields in your file(s). It should
be the same character for all files (if more than one is provided).<br />
A tab character will be assumed if you leave this field blank. See
<a href="#docs-file-separator"
title="Documentation for file-separator characters">
documentation for more information</a>.
</span>
</div>
</div>
<div class="form-group">
<div class="row mb-3">
<label for="txt-file-comment-character" class="col-sm-3 col-form-label">File Comment-Characters</label>
<div class="col-sm-9">
<div class="input-group">
<input id="txt-file-comment-character"
name="file-comment-character"
type="text"
value="#"
class="form-control" />
<span class="input-group-btn">
<button id="btn-reset-file-comment-character" class="btn btn-info">
Reset Default</button>
</span>
</div>
</div>
<span class="form-text text-muted">
This specifies that lines that begin with the character(s) provided will be
considered comment lines and ignored in their entirety. See
<a href="#docs-file-comment-character"
title="Documentation for comment characters">
documentation for more information</a>.
</span>
</div>
</div>
<div class="form-group">
<div class="row mb-3">
<label for="txt-file-na" class="col-sm-3 col-form-label">File "No-Value" Indicators</label>
<div class="col-sm-9">
<div class="input-group">
<input id="txt-file-na"
name="file-na"
type="text"
value="- NA N/A"
class="form-control" />
<span class="input-group-btn">
<button id="btn-reset-file-na" class="btn btn-info">Reset Default</button>
</span>
</div>
</div>
<span class="form-text text-muted">
This specifies strings in your file indicate that there is no value for a
particular cell (a cell is where a column and row intersect). Provide a
space-separated list of strings if you have more than one way of
indicating no values. See
<a href="#docs-file-na" title="Documentation for no-value fields">
documentation for more information</a>.</span>
</div>
</div>
</div>
{%endmacro%}
{%macro display_csv_fields_documentation()%}
<dl>
<dt id="docs-file-separator">File separator</dt>
<dd>The files you provide should be character-separated value (CSV) files.
We need to know what character you used to separate the values in your
file. Some common ones are the Tab character, the comma, etc.<br />
Providing that information makes it possible for the system to parse and
process your files correctly.<br>
<strong>NOTE:</strong> All the files you upload MUST use the same
separator.</dd>
<dt id="docs-file-comment-character">Comment characters</dt>
<dd>We support use of comment lines in your files. We only support one type
of comment style, the <em>line comment</em>.<br />
This mean the comment begins at the start of the line, and the end of that
line indicates the end of that comment. If you have a really long comment,
then you need to break it across multiple lines, marking each line a
comment line.<br />
The "comment character" is the character at the start of the line that
indicates that the line is a line comment.<br />
You can provide more than one comment character, separated by spaces.</dd>
<dt id="docs-file-na">No-Value indicator(s)</dt>
<dd>Data in the real world is messy, and in some cases, entirely absent. You
need to indicate, in your files, that a particular field did not have a
value, and once you do that, you then need to let the system know how you
mark such fields. Common ways of indicating "empty values" are, leaving
the field blank, using a character such as '-', or using strings like
"NA", "N/A", "NULL", etc.<br />
Providing this information will help with parsing and processing such
no-value fields the correct way.</dd>
</dl>
{%endmacro%}
{%macro add_csv_fields_event_handlers()%}
<script type="text/javascript">
$(function(evt) {
/* The reset buttons */
$("#btn-reset-file-separator").on("click", (event) => {
event.preventDefault();
$("#txt-file-separator").val("\t");
$("#txt-file-separator").trigger("change");
});
$("#btn-reset-file-comment-character").on("click", (event) => {
event.preventDefault();
$("#txt-file-comment-character").val("#");
$("#txt-file-comment-character").trigger("change");
});
$("#btn-reset-file-na").on("click", (event) => {
event.preventDefault();
$("#txt-file-na").val("- NA N/A");
$("#txt-file-na").trigger("change");
});
});
</script>
{%endmacro%}
|