I have a csv-utf8 text file, which has two "columns", like:
Name,Age <--- "header" with db field names
Erel,368 <--- data
Me,99
If I try to read the db field "Name" and use it in a query I get the error: "no such column: Name".
The field name displayed by log appears to be correct, but it probably contains non-displayable characters.
I read the name of the field from the file in this way:
Both DB and csv file are utf8. I tried other encodings without success.
The query written: "SELECT Name FROM..." works correctly.
I've attached the example.
Thank you
Name,Age <--- "header" with db field names
Erel,368 <--- data
Me,99
If I try to read the db field "Name" and use it in a query I get the error: "no such column: Name".
The field name displayed by log appears to be correct, but it probably contains non-displayable characters.
I read the name of the field from the file in this way:
B4X:
' Reads csv utf8 file
Dim lstLines As List = File.ReadList(File.DirAssets, "CSV_UTF8_FileToImport.csv")
' First "row" of csv file - a header with field names.
Dim FieldName As String = Regex.Split(",", lstLines.Get(0))(0)
'displays Name, correctly, but it probably contains non-displayable characters.
Log("Field name: " & FieldName)
Both DB and csv file are utf8. I tried other encodings without success.
The query written: "SELECT Name FROM..." works correctly.
I've attached the example.
Thank you
Attachments
Last edited: