iOS Question LoadCSV problem

Discussion in 'iOS Questions' started by highflyer, Jun 13, 2015.

  1. highflyer

    highflyer Member Licensed User

    Reading a csv file with the following code, I'm not able to get proper data.

    Dim su As StringUtils
    Dim Table As List
    If File.Exists(File.DirDocuments, "em.csv") = False Then
    File.Copy(File.DirAssets, "em.csv"File.DirDocuments, "em.csv")
            Table = su.LoadCSV(
    File.DirDocuments, "em.csv"",")
    End If

    <B4IList: (
    "<B4IArray: 0x1666b6a0>",
    "<B4IArray: 0x16630b30>",
    "<B4IArray: 0x16631410>",
    "<B4IArray: 0x1665cda0>",
    "<B4IArray: 0x166275e0>"

    Attached Files:

    • em.txt
      File size:
      281 bytes
  2. Erel

    Erel Administrator Staff Member Licensed User

    Actually the output looks correct. Each item is an array of strings:
    For Each Row() As String in Table
    For Each Col As String In Row
  3. highflyer

    highflyer Member Licensed User

    Thank you Erel.....
  4. KY Leng

    KY Leng Member Licensed User

    Below is my code:

    Dim SU As StringUtils
    Dim TB As List
    Dim iRow As Int
    Dim FileDirectory As String
    FileDirectory = File.DirAssets
    TB = SU.LoadCSV(FileDirectory,"TelecomLaw.csv","|") 'Line 472

    And I got the error as below:

    Error occurred on line: 472 (Main)
    Error reading file. Incorrect encoding
    Stack Trace: (
    CoreFoundation <redacted> + 150
    libobjc.A.dylib objc_exception_throw + 38
    CoreFoundation <redacted> + 0
    Telecom Law -[B4IFile ReadString2:::] + 500
    Telecom Law -[B4IFile ReadString::] + 86
    Telecom Law -[iStringUtils LoadCSV2::::] + 206
    Telecom Law -[iStringUtils LoadCSV:::] + 48
    CoreFoundation <redacted> + 68
    CoreFoundation <redacted> + 292
    Telecom Law +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1786
    Telecom Law -[B4IShell runMethod:] + 574
    Telecom Law -[B4IShell raiseEventImpl:method:args::] + 1998
    Telecom Law -[B4IShellBI raiseEvent:event:params:] + 1442
    Telecom Law __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
    libdispatch.dylib <redacted> + 10
    libdispatch.dylib <redacted> + 22
    libdispatch.dylib _dispatch_main_queue_callback_4CF + 1532
    CoreFoundation <redacted> + 8
    CoreFoundation <redacted> + 1590
    CoreFoundation CFRunLoopRunSpecific + 516
    CoreFoundation CFRunLoopRunInMode + 108
    GraphicsServices GSEventRunModal + 160
    UIKit UIApplicationMain + 144
    Telecom Law main + 108
    libdyld.dylib <redacted> + 2

    Any idea please ?
  5. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for this question.
  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