John Kouraklis 94 Posted July 1, 2019 Hi all, I need to add CSV import functionality in an app and before I write it myself I thought to have a look at CDATA's CSV component. One thing I am not clear after checking their website; is it a FMX or VCL component? Anyone has used it? Thanks Share this post Link to post
ertank 27 Posted July 2, 2019 Hello, You did not clarify if you need FMX or VCL or both in your question. I am using SMImport, SMExport suite from http://www.scalabium.com for years. Never had the need to look for another solution. They are VCL only. 1 Share this post Link to post
John Kouraklis 94 Posted July 2, 2019 @ertank Hi, sorry I missed that. I am looking for a FMX component. I'll have a look at scalabium. Maybe they have one. Thanks Share this post Link to post
Rollo62 536 Posted July 2, 2019 (edited) https://www.cdata.com/drivers/csv/firedac/ Good questions, these are basically FireDac componenets, so they should be cross-platform. Not checked if they have any visual components too, but I don't think so. If the Enterprise connectors wouldn't be only available bundled as 80+, 160+ components, but available single or more granular, I would have tested them already. Edited July 2, 2019 by Rollo62 Share this post Link to post
Sherlock 663 Posted July 2, 2019 But I do hope it's either free, or very inexpensive. Importing CSV is far from being magic. It's more like splitting a String into a TStringlist and trying some StrToInt or StrToFloat... Otherwise, try looking into these threads from the mother ship https://www.delphipraxis.net/51457-csv-editor.html https://www.delphipraxis.net/158355-csvviewer-zum-betrachten-von-csv-dateien.html 1 1 Share this post Link to post
Angus Robertson 574 Posted July 2, 2019 TStringlist has DelimitedText and CommaText properties that works for many CSV files, free and one line of code. However it treats spaces as a delimiter, so I use a minor variant that also always writes delimiters. Angus Share this post Link to post
Attila Kovacs 629 Posted July 2, 2019 1 hour ago, Angus Robertson said: it treats spaces as a delimiter, http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Classes_TStrings_StrictDelimiter.html Share this post Link to post
John Kouraklis 94 Posted July 2, 2019 2 hours ago, Angus Robertson said: TStringlist has DelimitedText and CommaText properties that works for many CSV files, free and one line of code. However it treats spaces as a delimiter, so I use a minor variant that also always writes delimiters. Angus You need to set StrictDelimiter:=true to force TStringList to use only the DelimiterChar and not the spaces Share this post Link to post
Angus Robertson 574 Posted July 2, 2019 I wrote the CSV component 20 years ago before TStringlist got more fancy. Angus 1 Share this post Link to post
John Kouraklis 94 Posted July 3, 2019 For anyone who is interested, I contacted CData and they told me their FireDac components do not support FMX at all. Disappointing... 1 Share this post Link to post
baeckerg 6 Posted July 4, 2019 Did you look at TMS FlexCel? It works on VCL and FMX Share this post Link to post
John Kouraklis 94 Posted July 4, 2019 FlexCel reads/writes only XLS files, doesn't it? I will have another look again. Thx Share this post Link to post
Steve Maughan 26 Posted July 4, 2019 4 hours ago, John Kouraklis said: FlexCel reads/writes only XLS files, doesn't it? I will have another look again. Thx FlexCel also read / writes CSV files 1 Share this post Link to post
Sue King 5 Posted July 7, 2019 kbmMemTable has a good CSV import unit for importing into their memory table. I use this and then process the data from there. It isn't an import component as such but part of the table. It can be used in both VCL and FMX. Share this post Link to post
John Kouraklis 94 Posted July 8, 2019 @Sue King Thanks. will have a look Share this post Link to post