[精讚] [會員登入]
623

讀取特定資料夾下的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

你可能感興趣的文章

keycloak 透過java client lib新增user 使用keycloak-admin-client lib maven <dependency> <gro

Thread java thread

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

[vue.js] 設定 content type 今天在wickt 端怎麼就是收不到vue.js 以post 傳過來的資料 找了好久才發現 application/jso

spring boot 使用jdbc連接mariadb spring boot, mariadb, jdbc, rowmapper

Arrays.asList 後想再add出現 UnsupportedOperationException 這個問題真是搞死我了 List<String> fruits = Arrays.asList("a

隨機好文

apache 反向代理 80轉443轉8080 apache, proxy pass

hoc2018灑水機器人 灑水機器人的工作是替行道樹灑水,機器人的灑水範圍有限(左前方、左方、左後方),請寫程式控制機器 人判斷須灑水的狀況。每顆

Arrays.asList 後想再add出現 UnsupportedOperationException 這個問題真是搞死我了 List<String> fruits = Arrays.asList("a

ArrayList 與 HashMap 範例 public static void main(String[] args) { String titleIds = &

在docker裡跑spring boot+mongo(二) 使用docker-compose 管理多個container 前篇使用docker run 一次建一個container