-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_csv_odis.php
executable file
·45 lines (33 loc) · 1.04 KB
/
import_csv_odis.php
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
<?php
//$data = file_get_contents('datasources/AATcsv.txt');
// record - recordId,record - aatNedId,record - subjectId,record - status,record - pt,record - bt,record - uf,record - eq
$row = 1;
$sub_id = 1;
$termsArray = array();
if (($handle = fopen('datasources/ODIS-reconciliation.csv', 'r')) !== FALSE) {
while (($data = fgetcsv($handle, 406326, ",")) !== FALSE) {
$row++;
$recordId = $data[0];
$term = $data[4];
$return_text = $data[2];
$new_term = array();
if(strlen($recordId)>1)
{
$new_term['id'] = $recordId;
}
else
{
echo "geen id gevonden\n";
}
$new_term["text_to_match"] = $term;
$new_term["return_text"] = $return_text;
if($new_term['return_text']=="")
{
echo "Geen term, dit is raar...";
}
// eerste keer toevoegen ...
$termsArray[] = $new_term;
}
fclose($handle);
}
file_put_contents('datasources/odisdata.data', serialize($termsArray));