[精讚] [會員登入]
614

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

你可能感興趣的文章

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

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

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

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

Thread java thread

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

隨機好文

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

臺中市雲端校務系統與Windows AD帳號整合(5) 安裝java環境

雲端校務系統與OPENLDAP帳號整合(2) openldap,雲端校務

[scratch2] 分數排名 在清單中隨机產生5名學生的考試分數, 再利用另一個清單排名 想法, 分數愈高者排名愈好, 例如名次是第5名, 那分數是最

在docker裡跑spring boot+mongo(一) 系統安裝docker ce centos7 + docker ce https://docs.docker.com/in