[精讚] [會員登入]
608

讀取特定資料夾下的xls檔

讀取特定資料夾下的xls檔

分享此文連結 //n.sfs.tw/13053

分享連結 讀取特定資料夾下的xls檔@igogo
(文章歡迎轉載,務必尊重版權註明連結來源)
2019-01-25 10:08:19 最後編修
2019-01-25 10:18:24 By igogo
 

 

讀取特定資料夾下的xls檔


 String docPath = String.format("%s/docs", System.getProperty("user.dir"));

        List<Path> xlsPaths = new ArrayList<>();
        try (Stream<Path> paths = Files.walk(Paths.get(docPath))) {
            paths.filter(Files::isRegularFile)
                    .filter(p -> p.toString().endsWith(".xls"))
                    .forEach(xlsPaths::add);
        }

        xlsPaths.forEach(xls -> System.out.println(xls.toString()));

 

https://stackoverflow.com/questions/1844688/how-to-read-all-files-in-a-folder-from-java

https://stackoverflow.com/questions/29574167/how-to-use-files-walk-to-get-a-graph-of-files-based-on-conditions

END

你可能感興趣的文章

java.time 時間 instant java.time

刪除資料夾內的檔案 lambda 一行文 Arrays.stream(new File("/folder/path").

java-身份証字號驗証 FormatCheck.java public class FormatCheck { private volatile

停止多執行緒 利用主程式呼叫多執行緒時, 要怎麼停止正在執行的多執行緒

Spring Boot Maven wrappers maven, mvnw, build command

java lambda files filter java, files filter, lambda

隨機好文

[vue.js] 動態的props 做parent-child components 雙向綁定 vue.js props components camel-case

java.time 時間 instant java.time

找尋多個文件夾中最新檔案(jpg,png,txt)並複製到nexus資料夾 找尋多個文件夾中最新檔案(jpg,png,txt)並複製到集中資料夾

如何在docker 的nginx 做另一個container的反向代理 環境 docker 中一container 跑 nginx 對外服務80 port, http://server 另一c

利用google apps script 將Google sheet 中兩個工作表中的資料對應 如何整理google測驗收回來的學生資料