Posts

Showing posts from December, 2009

Read an Excel file and return a string-Java

package beans;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author anjana
*/
import java.io.*;
import jxl.*;
import java.util.*;

import java.sql.*;

public class ConvertCSV {

public String str = "";
String shippingcompanyID = "1";
String Excelfilnename = "";

public String getExcelfilnename() {
return Excelfilnename;
}

public void setExcelfilnename(String Excelfilnename) {
this.Excelfilnename = Excelfilnename;
}

public String getShippingcompanyID() {
return shippingcompanyID;
}

public void setShippingcompanyID(String shippingcompanyID) {
this.shippingcompanyID = shippingcompanyID;
}

// public void readExcelFile() {
public static void main(String args[]){
try {
String str = "";
String shippingcompanyID = "1";
//File to store data in form of CSV
File f = new File("D://T…