### Import CSV

An example of importing a CSV file into a TableView using the jStringUtils library.
CSV File test.txt stored in the diar app folder
00:06:18,,
00:03:56,1.4,21.3
00:02:05,0.8,22.9
00:11:18,,
00:04:17,1.6,22.4
00:12:34,,
00:11:18,123456789,
Note:
The lines in the CSV must be separated by commata. Each line must have 2 commata.
If this is not the case the tableviw can not be build.
B4J Code
The layout main.bjl contains 1 TableView called TableView1.
`Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private TableView1 As TableView
End Sub`
`Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Main")
MainForm.SetFormStyle("UTILITY")
MainForm.Show
FillTableView
End Sub`
`Sub FillTableView
Dim su As StringUtils
Dim l As List = su.LoadCSV(File.dirapp,"test.txt", ",")
For i = 0 To l.Size - 1
TableView1.Items.Add(l.Get(i))
Next
End Sub`
'Close the app - add any specifics here
`Sub AppClose
MainForm.Close
End Sub`
'Handle form closing via system close (top right X button)
`Sub MainForm_CloseRequest (EventData As Event)
AppClose
End Sub`

Changed: , Category: TableView, File: T6C259M1891.htm, ID: 1891