CsvReader reader=new CsvReader("csvfile");//use csvreader.jar file
while (reader.readRecord()) {
// This deals with embedded newlines inside quote-escaped fields
int firstRecordColumnCount = reader.getColumnCount();
String line = reader.getRawRecord();
string columnvalue=reader.get(position) ;//
//to read a file
FileContents contents = new FileContents();
FileReader in = new FileReader(args[ 3]);
StringBuffer fileContents = new StringBuffer();
int c;
while ((c = in.read()) != -1) {
fileContents.append((char) c);
}
contents.setFile(fileContents.toString());
while (reader.readRecord()) {
// This deals with embedded newlines inside quote-escaped fields
int firstRecordColumnCount = reader.getColumnCount();
String line = reader.getRawRecord();
string columnvalue=reader.get(position) ;//
//to read a file
FileContents contents = new FileContents();
FileReader in = new FileReader(args[ 3]);
StringBuffer fileContents = new StringBuffer();
int c;
while ((c = in.read()) != -1) {
fileContents.append((char) c);
}
contents.setFile(fileContents.toString());
No comments:
Post a Comment