Tag : java , By : Adam May
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further The File you are trying to access isn't really a .xls file even though the extension may indicate that it is. Open the file in Excel and do "Save As" and then try to access the file. You should be fine. GoodLuck!
|
Date : March 29 2020, 07:55 AM
wish help you to fix your issue So guys i finally found the best solutions i guess to read and import data from my Tab-separated file using openCSV library, and it goes well for all types of CSV file (Character separated value) with titles, we have just to change the separator. Here is the code: File xlsFile = new File(path);
CSVReader reader = new CSVReader(new FileReader(xlsFile), '\t');
ArrayList<String[]> data = new ArrayList<String[]>();
String[] nextLine;
while ((nextLine = reader.readNext()) != null) {
final int size = nextLine.length;
//handle empty lines
if (size == 0) {
continue;
}
String debut = nextLine[0].trim();
if (debut.length() == 0 && size == 1) {
continue;
}
data.add(nextLine);
}
String[] titles = data.get(0);
data.remove(0);
ArrayList<Map<String, String>> mappedData = new
ArrayList<Map<String, String>>(data.size());
final int titlesLength = titles.length;
for (String[] oneData : data) {
final Map<String, String> map = new HashMap<String, String ();
for (int i = 0; i < titlesLength; i++) {
final String key = titles[i];
final String value = oneData[i];
map.put(key, value);
}
mappedData.add(map);
}
|
Tag : java , By : Anonymous
Date : March 29 2020, 07:55 AM
|
Date : March 29 2020, 07:55 AM
|
Invalid signature. Expected signature base string, JAVA
Tag : java , By : new Blackberry devel
Date : March 29 2020, 07:55 AM
|