Ricebridge
Search This Site
Aug 08 2008 19:16 UTC

Got a question for us?
Just Ask!


$15 Gift Certificate for every bug you find.

  • Visa MasterCard
  • Visa Delta Laser
  • WorldPay

Bookmark Forum Topic for Ricebridge Java CSV Components at del.icio.us Digg Forum Topic for Ricebridge Java CSV Components at Digg.com Bookmark Forum Topic for Ricebridge Java CSV Components at reddit.com Bookmark Forum Topic for Ricebridge Java CSV Components at YahooMyWeb Bookmark Forum Topic for Ricebridge Java CSV Components at Spurl.net Bookmark Forum Topic for Ricebridge Java CSV Components at Simpy.com Bookmark Polyphasic Mutants at NewsVine Blink this Forum Topic for Ricebridge Java CSV Components at blinklist.com Bookmark Forum Topic for Ricebridge Java CSV Components at Furl.net Fark Forum Topic for Ricebridge Java CSV Components at Fark.com

Topic: Class cast exception

Back to Topics (1 to 2 of 2) Posts RSS Feed
 
Hi,

When i try to use CsvManager to load the file into List of List i am getting Class Cast exception. could any one please help. this is my code

package csv;
import com.ricebridge.csvman.CsvManager;
import java.util.*;
import java.io.*;


public class ReadCsv {

public void readDecisionTable(String fileName) {

File csvFile = new File(fileName);
CsvManager csvManager = new CsvManager();
csvManager.setSeparator(";");
List data = csvManager.load( csvFile );

for( int line = 0; line < data.size(); line++ ) {
System.out.println( "line: "+line );

List fields = (List) data.get(line);//Class cast exception
for( int field = 0; field < fields.size(); field++ ) {
System.out.println( "field "+field+" has value: " + fields.get(field) );
}
}
decisionTableData.get(lineCount);



}
}
Ayyappan Chandrasekaran Nov 25 2005 11:03
To get your code working, use the loadAsLists method. The load method returns a List of String[] arrays, which is not what you want.
Richard Rodger [Ricebridge Staff] Nov 25 2005 12:20
 
Show All (total: 2)




















comment on this page Home | Search | About Us | Contact Us | Our Products | Documentation | Resources | Login
Copyright © 2004-2008 Ricebridge. All Rights Reserved.