importing a csv file into a java swing table

后端 未结 3 656
一生所求
一生所求 2021-01-17 02:34

I have a csv file of all the stock quotes on in the nyse. first column is symbol second column is the name of the company.

I have a search box and table made in netb

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-17 03:00

        package recommendation.event.test;
    
        import java.io.FileReader;
        import com.csvreader.CsvReader;
        public class ReadCSV {
        public static void main (String [] args){
        try {
    
    
            CsvReader products = new CsvReader("resources/Event Recommendation Engine Challenge/data/test.csv");
    
            products.readHeaders();
    
            while (products.readRecord())
            {
                String user = products.get("user");
                String event = products.get("event");
                String invited = products.get("invited");
                String timestamp = products.get("timestamp");
    
                System.out.println(user + " : " + event+" : "+invited+" : "+timestamp);
            }
    
            products.close();
        }catch (Exception e) {
            // TODO: handle exception
        }
    
            }
        }
    

提交回复
热议问题