Android Question Opencsv java lib with JavaObject

Discussion in 'Android Questions' started by b4auser1, Aug 22, 2015.

  1. b4auser1

    b4auser1 Well-Known Member Licensed User

    How to use Opencsv java lib with JavaObject ?
    Code:
    CSVReader reader = new CSVReader(new FileReader("yourfile.csv"));
         
    String [] nextLine;
         
    while ((nextLine = reader.readNext()) != null) {
            // nextLine[] 
    is an array of values from the line
            System.out.println(nextLine[
    0] + nextLine[1] + "etc...");
         
    }
     
  2. b4auser1

    b4auser1 Well-Known Member Licensed User

    SOLVED:
    Code:
    Public Sub Opencsv_CSVReader(a_Reader As TextReaderAs JavaObject
        
    Dim l_joCSVReader As JavaObject
        
    Return l_joCSVReader.InitializeNewInstance("com.opencsv.CSVReader"Array As Object(a_Reader))
    End Sub

    Public Sub Opencsv_readNext(a_joCSVReader As JavaObjectAs List
        
    Dim l_sColumns() As String = a_joCSVReader.RunMethod("readNext"Null)
        
    Return l_sColumns
    End Sub
     
    stevel05 likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice