Skip to Content
author's profile photo Former Member
Former Member

Java CSV

Hi, I'm writing a program in java that has to upload a csv file from the disk, but i can´t find examples to guide me, (I´m new in Java HTMLB programing).

Can anybody help me ...

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 14, 2004 at 09:50 AM

    Hi Virginia,

    could you please be a little bit more specific? Do you have to "parse" the contents of the file or is it just a data transfer?

    Regards

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Virginia,

      You could download the util.jar file (from http://ostermiller.org/utils/download.html).Set your CLASSPATH environment variable to include this utils.jar.

      (read the installation on the same page). You can try out examples.

      import com.Ostermiller.util.ExcelCSVParser;

      ....

      File f = new File (example.csv);

      FileInputStream file_stream = new FileInputStream(f);

      ....

      String[][] values = ExcelCSVParser.parse( file_stream ); // values contains the parsed values which can be displayed in html table.

      ..

      Hope this is of some help.

      Regards

      Shilpa

  • author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2004 at 10:41 AM

    Well i managed to upload the cvs file with the file upload, and them separated the ";" with Tokenizer.

    Now i have a problem with dates.

    one of the fields is a date type and i want to separe the them in working days and weekend days.

    I tried to use the SimpleDateFormat and Calendar,but nothing.

    Anyone what´s to help me?

    Add comment
    10|10000 characters needed characters exceeded