How to import csv generated file via API
Hello,
I exported a workitem query result from RTC in csv.
What is the best way to read the file in Java via API? I tried the following but it doesn't work.
Thanks for your help.
BufferedReader br = null;String line = "";char cvsSplitBy = "\t";try {br = new BufferedReader(new FileReader("c:/output.csv"));while ((line = br.readLine()) != null) {.................}.......}
2 answers
You can search for a generic way of handling this as suggested, but if you like to know how the RTC SDK reads
in CSV files you can have a look at the following method:
In particular this method creates the BufferedReader like the following:
in CSV files you can have a look at the following method:
In particular this method creates the BufferedReader like the following:
String firstLine; String delim= userDelim;
BufferedReader br= null;
try {
File csvFile= new File(csvFileName);
br= new BufferedReader(new InputStreamReader(new DataInputStream(new FileInputStream(csvFile)), detectCharset(csvFile)));
if ((firstLine= br.readLine()) != null) {
}
} finally {
if(br != null) {
br.close();
}
}
Comments
sam detweiler
Mar 10 '14, 5:15 p.m.hm.. thats what I use all the time., or "," for comma separated
EclipseTalk .
Mar 10 '14, 5:35 p.m.I don't have an option to select anything when I export from the RTC web UI....