-
Notifications
You must be signed in to change notification settings - Fork 5
/
Parse.html
49 lines (43 loc) · 1.62 KB
/
Parse.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
<!doctype html>
<html>
<head>
<title>Concator</title>
<script>
function CSVToArray(e,t){t=t||",";var n=new RegExp("(\\"+t+"|\\r?\\n|\\r|^)"+'(?:"([^"]*(?:""[^"]*)*)"|'+'([^"\\'+t+"\\r\\n]*))","gi");var r=[[]];var i=null;while(i=n.exec(e)){var s=i[1];if(s.length&&s!=t){r.push([])}if(i[2]){var o=i[2].replace(new RegExp('""',"g"),'"')}else{var o=i[3]}r[r.length-1].push(o)}return r}
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>
</head>
<body>
<script>
var data0;
var alt = {};
function makealt(url){
$.ajax({url:url,success:function(request){
data = CSVToArray(request);
for (var i = 0; i < data.length; i++){
var l = 'c'+data[i][0];
var alt[l] = data[i][1];
}
}});
}
function tcgprint(url){
console.log('ok');
$.ajax({url:url,success:function(request){
data0 = CSVToArray(request);
console.log(data0);
for (var i = 0; i < data0.length; i++){
l = 'c'+data0[i][0];
adate = (data0[i][1] !== '') ? (new Date(data0[i][1]).getTime())
: (new Date(alt[l].date));
expression = ""+data0[i][0]+','+adate+'\n';
$('pre').append(expression);
}
}
});
}
makealt('alpha-TCG-TGPTrixie.csv');
tcgprint('alpha-TCG-Mele.csv');
</script>
<pre></pre>
</body>
</html>