用clojure docjure编辑一些excel-cells

我正在尝试使用clojure docjure( https://github.com/mjul/docjure )编辑Excel表格中的某些单元格。

在docjure文档显示如何创build一个新的电子表格,但我不想这样做。 我想要做的是读出excel表格的一些信息,计算一些新的值,然后把它们写回到同一表格的特定单元格。

那么前两个步骤工作。 我只是不知道如何写回数值。

我怎样才能做到这一点?

看看testing通常是有用的,因为它们也可以在一定程度上logging代码。 我发现一个相关的文件: https : //github.com/mjul/docjure/blob/master/test/dk/ative/docjure/spreadsheet_test.clj#L126

在那个文件中我发现:

 (deftest set-cell!-test (let [sheet-name "Sheet 1" sheet-data [["A1"]] workbook (create-workbook sheet-name sheet-data) a1 (-> workbook (.getSheetAt 0) (.getRow 0) (.getCell 0))] (testing "set-cell! for Date" (testing "should set value" (set-cell! a1 (july 1)) (is (= (july 1) (.getDateCellValue a1)))) (testing "should set nil" (let [^java.util.Date nil-date nil] (set-cell! a1 nil-date)) (is (= nil (.getDateCellValue a1))))) (testing "set-cell! for String" (testing "should set value" (set-cell! a1 "foo") (is (= "foo" (.getStringCellValue a1))))) (testing "set-cell! for boolean" (testing "should set value" (set-cell! a1 (boolean true)) (is (.getBooleanCellValue a1)))) (testing "set-cell! for number" (testing "should set int" (set-cell! a1 (int 1)) (is (= 1.0 (.getNumericCellValue a1)))) (testing "should set double" (set-cell! a1 (double 1.2)) (is (= 1.2 (.getNumericCellValue a1))))))) 

我现在无法testing这个,但是你在找什么?