public void doConvertFileAmazon(String pathFolderRead, String pathFolderWrite, String bpcnum) throws Exception {
Collection<File> listFiles = FileUtils.listFiles(new File(pathFolderRead), new String[] { "xlsx" }, false);
for (File file : listFiles) {
StringBuffer sb = new StringBuffer();
List<String[]> listRow = ExcelWriter.read(file, 22);
for (String[] cols : listRow) {
sb.append("BEV01;SRN;;" + bpcnum + ";SL;" + cols[3] + ";" + cols[0] + ";" + cols[1] + ";" + cols[13]
+ ";" + cols[17] + ";1;;\r\n");
}
String filename = FilenameUtils.getBaseName(file.getName());
FileUtils.writeStringToFile(new File(pathFolderWrite, filename + ".csv"), sb.toString(), "UTF-8");
}
}
Asked
Active
Viewed 34 times
1
-
1Check this question for several solutions https://stackoverflow.com/questions/5710059/java-foreach-skip-first-iteration . – Renis1235 Nov 17 '21 at 14:27
-
2Does this answer your question? [java foreach skip first iteration](https://stackoverflow.com/questions/5710059/java-foreach-skip-first-iteration) – Renis1235 Nov 17 '21 at 14:28
-
how i can read only one line of the file? – gian Nov 19 '21 at 15:16