[精讚] [會員登入]
698

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

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

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

java lambda files filter java, files filter, lambda

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

Thread java thread

隨機好文

臺中市雲端校務系統與Windows AD帳號整合(4) 雲端校務系統與Windows AD的架構

javascript 陣列 javascript 陣列可以放各种型別的元素 let data = [1,2,"john",tru

使用vbs設定windows 10 靜態IP setting static ip Set Adapter = GetObject("winmgmts:Win

spring boot 整合到 nginx 於subpath 將spring boot 位在docker中, 對外服務19090 程式佈署到nginx 伺服器的 subpath上 對

透過軟廣, 讓電腦播放遠端影片 播放教育部台語動畫 edge路徑 C:Program Files (x86)MicrosoftEdgeApplicati