Hi, All
Just trying rSD lib with ESP32 and SPI card slot.
The main, it's usage "/" root prefix at the file names.
But how to save multiline text .CSV files correctly ?
Such sub...
...gives this file content:
Any help ?
Just trying rSD lib with ESP32 and SPI card slot.
The main, it's usage "/" root prefix at the file names.
But how to save multiline text .CSV files correctly ?
Such sub...
B4X:
private Sub Savelog As Boolean
If sd.OpenReadWrite("/log.dat") = True Then
sd.Position = sd.CurrentFile.Size
For i = 0 To 4
Dim buff() As Byte
buff = BC.StringToBytes(NumberFormat (i,10,0))
sd.Stream.WriteBytes(buff,0,buff.Length)
buff = BC.StringToBytes(";")
sd.Stream.WriteBytes(buff,0,buff.Length)
buff = BC.StringToBytes("Column_")
sd.Stream.WriteBytes(buff,0,buff.Length)
buff = BC.StringToBytes(NumberFormat(i, 2, 0))
sd.Stream.WriteBytes(buff,0,buff.Length)
buff = BC.StringToBytes(";")
sd.Stream.WriteBytes(buff,0,buff.Length)
buff = BC.StringToBytes(CRLF)
sd.Stream.WriteBytes(buff,0,buff.Length)
Next
sd.Close
Log("Saved to file OK")
Return True
Else
Log("SD card writing error")
Return False
End If
End Sub
...gives this file content:
No idea why...0000000004;Column_04;
•щжеті”$дПФo’4ѓ¦Ўq ы c'.ђУСЖЧА[ј8ћ! •)¶ї“ћНaС‰ьъW7hRРkЂЇєR яy®ЌЇ7Сё, 6ЫАгЂ8€gЪњ\ѕN»Бhѓд}MJ%Xu
Џcз$ТѕќљuЌѓЁ–u№В·=}Бє¦lXwЉ:ВХvЫ™;УцЎзІ2ь„«Б:„!i»’;CЉh§?ЇCхe%> ыOtШрЮ@ђZЇdгIђ1ZЙЛЙrЇ{ВЁWJЃ*s*РщЭэьW0бзI^zHАю јёVш3]ЪwlЕ5;ёњђг}Ґ]^ЦЧ1H0IЪP
ЬнсВ#фо!Z}±Ћwт}‚
)%>d“ЖVяЫЎЛn©Цdєq)Аj9ЧнxZTђ5!7ҐРЭфлщ¶¦=жБ•{=РА› ЖоОюHV(™Ѕр[Э8–3(MЭXF‹›1VG‹§iїГeГlъ©kЁџ]„.9кЕ–ЩzАЄ‰уКtЂк[0000000000;Column_00;
l™оЃI“Ф`лESMл±AN©q
;gЃmeНМkзЪљўДшіМ~Н[уёіЙ"_ЬVМмн/‹ґЫ§(Е‡Љmv*uє`gBЇ0000000000;Column_00;
Any help ?