近況 + JavaScript - 聖殿英雄傳說 MUD

Table of Contents

最近又開始 javascript 的練習,下半年起我又會很忙,之前
在公司寫的東西也需要調整,所以趁現在有空,複習一下。

剛剛先寫了以下的東西

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<script src="xlsx.core.min.js"></script>
<script src="FileSaver.min.js"></script>
<script src="xlsx.full.min.js"></script>

<script type=text/javascript>

function read_files()
{
files=document.getElementById("files").value;
filters=document.getElementById("filters").value;
document.getElementById("show_results").innerText=
"files="+files+"\nfilters="+filters;
}

</script>

請選取一個 excel 檔案: <input type="file" id="files"><p>
請輸入篩選關鍵字: <input type="text" id="filters"><p>
<button id="buttons" onclick='read_files()'>讀取資料</button><p>

<table>
<tr><td id="show_results"></th></tr>
</table>
</html>


以上已經確認可 work。

主要想實驗,藉由給予的篩選關鍵字,去搜尋目標 excel 檔案內主要
sheet 的每一行,只要有 match 關鍵字的欄位,就把該行 show 出來
,這個明天起再 try 各種可行的做法。

一般來說透過 excel 的巨集也可以做到,不過巨集只靠自己研究實在
很難懂,還好 javascript 也有寫好的相關工具可用。


Laechan

--

All Comments

Kumar avatarKumar2020-03-17
假設EXCEL裡在格子寫 IF(1=1,好,壞),跑出來是好
Hedy avatarHedy2020-03-20
那會搜到好,還是搜到IF...這字串?
Tristan Cohan avatarTristan Cohan2020-03-24
還沒試,最近忙
Eartha avatarEartha2020-03-26
我只是好奇而已,因為我不會寫程式...
Kama avatarKama2020-03-31
我記得有dll是能讓C/C++去使用js語法的