metzeller_2013 Member Licensed User Longtime User May 24, 2014 #1 Good Day to all, I'm currently using sqlite and exporting my data to CSV format as my data output.... Everything goes well, but i noticed the output csv using string utility (su.savetoCSV) does not have a breakline to separate each row. Is there a way to put a breakline to separate each row in the CSV? TIA....
Good Day to all, I'm currently using sqlite and exporting my data to CSV format as my data output.... Everything goes well, but i noticed the output csv using string utility (su.savetoCSV) does not have a breakline to separate each row. Is there a way to put a breakline to separate each row in the CSV? TIA....
LucaMs Expert Licensed User Longtime User May 25, 2014 #2 SaveCSV adds a "breakline". The List to save must contain arrays of strings. For example: Code: Copy Private Arr1(2) as String Arr1(0) = "One" Arr1(1) = "Two" MyList.Add(Arr1) Private Arr2(2) as String Arr2(0) = "Three" Arr2(1) = "Four" MyList.Add(arr2) su.SaveCSV(Dir, FileName, ",", MyList) Upvote 0
SaveCSV adds a "breakline". The List to save must contain arrays of strings. For example: Code: Copy Private Arr1(2) as String Arr1(0) = "One" Arr1(1) = "Two" MyList.Add(Arr1) Private Arr2(2) as String Arr2(0) = "Three" Arr2(1) = "Four" MyList.Add(arr2) su.SaveCSV(Dir, FileName, ",", MyList)
Erel B4X founder Staff member Licensed User Longtime User May 25, 2014 #3 I'm currently using sqlite and exporting my data to CSV format as my data output.... Everything goes well, but i noticed the output csv using string utility (su.savetoCSV) does not have a breakline to separate each row. Click to expand... The end of line character in Android is Chr(10). If you are using Notepad then you will not see it. The solution is to use a better text editor such as Notepad++. Upvote 0
I'm currently using sqlite and exporting my data to CSV format as my data output.... Everything goes well, but i noticed the output csv using string utility (su.savetoCSV) does not have a breakline to separate each row. Click to expand... The end of line character in Android is Chr(10). If you are using Notepad then you will not see it. The solution is to use a better text editor such as Notepad++.
metzeller_2013 Member Licensed User Longtime User May 25, 2014 #4 thanks for the reply sir erel and sir lucaMS, That's the reason why i can't see it..... What i see is a small square ascii character.... is there a way to replace it with the regular CRLF? Upvote 0
thanks for the reply sir erel and sir lucaMS, That's the reason why i can't see it..... What i see is a small square ascii character.... is there a way to replace it with the regular CRLF?
Erel B4X founder Staff member Licensed User Longtime User May 25, 2014 #5 You can read the saved text with File.ReadString and then convert the end of line characters: Code: Copy Dim t As String = File.ReadString(...) t = t.Replace(Chr(10), Chr(13) & Chr(10)) File.WriteString(..., t) Upvote 0
You can read the saved text with File.ReadString and then convert the end of line characters: Code: Copy Dim t As String = File.ReadString(...) t = t.Replace(Chr(10), Chr(13) & Chr(10)) File.WriteString(..., t)
metzeller_2013 Member Licensed User Longtime User May 25, 2014 #6 Thank you very much for the reply sir Erel, I'll try this one..... Upvote 0