highflyer Member Licensed User Longtime User Jun 13, 2015 #1 Reading a csv file with the following code, I'm not able to get proper data. Code: Copy 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") Else Table = su.LoadCSV(File.DirDocuments, "em.csv", ",") Log(Table) End If Application_Start <B4IList: ( "<B4IArray: 0x1666b6a0>", "<B4IArray: 0x16630b30>", "<B4IArray: 0x16631410>", "<B4IArray: 0x1665cda0>", "<B4IArray: 0x166275e0>" )> Application_Active Attachments em.txt em.txt 281 bytes · Views: 571
Reading a csv file with the following code, I'm not able to get proper data. Code: Copy 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") Else Table = su.LoadCSV(File.DirDocuments, "em.csv", ",") Log(Table) End If Application_Start <B4IList: ( "<B4IArray: 0x1666b6a0>", "<B4IArray: 0x16630b30>", "<B4IArray: 0x16631410>", "<B4IArray: 0x1665cda0>", "<B4IArray: 0x166275e0>" )> Application_Active
Erel B4X founder Staff member Licensed User Longtime User Jun 14, 2015 #2 Actually the output looks correct. Each item is an array of strings: Code: Copy For Each Row() As String in Table For Each Col As String In Row Log(Col) Next Next Upvote 0
Actually the output looks correct. Each item is an array of strings: Code: Copy For Each Row() As String in Table For Each Col As String In Row Log(Col) Next Next
KY Leng Active Member Licensed User Longtime User Apr 19, 2016 #4 Below is my code: Dim SU As StringUtils Dim TB As List Dim iRow As Int Dim FileDirectory As String '---------------------------------------------------------- FileDirectory = File.DirAssets Log(FileDirectory) TB.Initialize 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:eventarams:] + 1442 Telecom Law __33-[B4I raiseUIEvent:eventarams:]_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 ? Upvote 0
Below is my code: Dim SU As StringUtils Dim TB As List Dim iRow As Int Dim FileDirectory As String '---------------------------------------------------------- FileDirectory = File.DirAssets Log(FileDirectory) TB.Initialize 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:eventarams:] + 1442 Telecom Law __33-[B4I raiseUIEvent:eventarams:]_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 ?
Erel B4X founder Staff member Licensed User Longtime User Apr 19, 2016 #5 Please start a new thread for this question. Upvote 0