-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImplementation Guide.html
72 lines (50 loc) · 1.77 KB
/
Implementation Guide.html
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
#Implementation example for website
#Parsing the Excel File
<script>
document.getElementById('upload').addEventListener('change', handleFile);
function handleFile(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = function (e) {
const data = new Uint8Array(e.target.result);
const workbook = XLSX.read(data, { type: 'array' });
// Assume the first sheet; modify as needed
const sheetName = workbook.SheetNames[0];
const worksheet = workbook.Sheets[sheetName];
// Convert sheet to JSON
const jsonData = XLSX.utils.sheet_to_json(worksheet);
processColumns(jsonData);
};
reader.readAsArrayBuffer(file);
}
function processColumns(jsonData) {
// Filter the desired columns
const desiredColumns = jsonData.map(row => ({
Column1: row['Column1'], // Replace 'Column1' with your column name
Column2: row['Column2'] // Replace 'Column2' with your column name
}));
// Output the JSON
const output = JSON.stringify(desiredColumns, null, 2);
document.getElementById('output').textContent = output;
}
</script>
#Example Post Request
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Send POST Request to Flask</title>
</head>
<body>
<h1>Submit Data to Flask App</h1>
<form action="/submit" method="POST">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<button type="submit">Submit</button>
</form>
</body>
</html>