StringUtils. SaveCSV (Dir As String, FileName As String, SeparatorChar As Char, Table As List)Saves the table as a CSV file.Dir - Output file folder. FileName - Output file name. SeparatorChar - Separator character. The character that separates fields. Table - A List with arrays of strings as items. Each array represents a row. All arrays should be of the same length. Example: Dim su As StringUtils su.SaveCSV(File.DirRootExternal, "1.csv", ",", table) B4A Question Replace characters between two characters in a text file. - Erel (first post)    Nov 1, 2020
My first guess is that the Chr(0) is doing no good.
True. No place for such character in a text file.
Why aren't you using StringUtils.SaveCSV?
Or B4XSerializator? Or KeyValueStore?
There are such simple ways to store lists or tables, why work hard?... B4A Question SQLlite to csv and Dbutils - Tom1s    Jun 25, 2015 Hi I tried this two different ways but no success. With cursor and with dbutils. In log there is this: mlist(ArrayList) and the row in the file is full of strange symbols. Dim mlist As List mlist.Initialize mlist=DBUtils.ExecuteMemoryTable(SQL1,"Select ID1,ID2,GPSLat,GPSLon FROM table where status=3",Null,0) Log("mlist" & mlist) Dim su As StringUtils su.SaveCSV(File.DirInternal,"marker_data.csv","|",mlist)... B4A Question How do I save a list of maps to a CSV? - Erel (first post)    Apr 2, 2017 You can save listOfArrays with StringUtils.SaveCSV.
If it doesn't work then please post the full error message from the logs (with the code I posted).... B4J Question exportTableViewToCSV problem - Mikelgiles (first post)    Apr 8, 2017   (1 reaction) I belive that, that code could be better.
Dim Su as stringutils.
su.SaveCSV(dirData, filename, ",", tv.items)
That's all you need to save the tableview into an csv without the loop.... B4J Question from SQLite to MySQL - Erel (first post)    Jul 24, 2015 You can export the data to a CSV file quite easily. See StringUtils.SaveCSV.... B4A Question Create a .txt file from a database - fixit30 (first post)    Jul 14, 2017 To save the data to a csv file use DBUtils.ExecuteMemoryTable to return your query as a List, then use StringUtils.SaveCSV to save to a csv file.... B4A Library [Class] Flexible Table - slugger (first post)    Nov 21, 2013 I modified your source code by myself, I changed the StringUtils1.SaveCSV2(Dir, Filename, ",", Data, headers) to StringUtils1.SaveCSV(Dir, Filename, ",", Data)... B4A Question [solved] missing rows in saved CSV file? - Erel (first post)    Jan 2, 2020   (2 reactions) StringUtils.SaveCSV2 writes all the data. I'm pretty sure that the problem is somewhere else. If you can try to reproduce it in a small project.
The only other clue I have is that the CSV file is apparently encoded as "Windows 1252: Western European" instead of the UTF-8 I expected, but that may be a consequence of reading the file off the connected device using Windows... B4A Question SQLite Table to CSV file - Erel (first post)    Sep 24, 2015 You should use StringUtils.SaveCSV to create a csv file. The above code will create a corrupted CSV file is there is a comma or quote in one of the fields.... B4A Question Save CSV method for SQL Cursor - Erel (first post)    Feb 23, 2014 You should use DBUtils.ExecuteMemoryTable and then convert it to csv with StringUtils.SaveCSV.... Page: 1   2   3   4   5   6   7   |