[精讚] [會員登入]
639

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

你可能感興趣的文章

spring boot jpa 使用多個欄位排序 我有一entity 叫 team 資料欄下如下 @Id @GeneratedValue(strategy = Gener

ArrayList 想移除特定值 想移出water, 使用lambda 的方式如下 List<String> fruits = new Arr

利用maven建立一個可執行的jar檔 利用maven建立一個可執行的jar檔

Spring Boot Maven wrappers maven, mvnw, build command

java lambda files filter java, files filter, lambda

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

隨機好文

axios vuejs application/x-www-form-urlencoded 送資料 VUE.JS 以 application/x-www-form-urlencoded 送資料

Spring Boot Maven wrappers maven, mvnw, build command

spring boot 3 建立 Basic Authentication 參考以下網站, 建立一個http basic authentication 為例 https://www.geeksfo

vue js 與teleport vue js 與 teleport 範例 <!DOCTYPE html> <html> <