FDDataMove CSV to FDMemTable1

Can anyone supply example easy way how to use FireDac to load CSV file into FDMemTable, and then (after edit, rename columns, drop columns) move result data to new table in database (Firebird)..

I have managed MoveData to import data from CSV, but only if I prepare fields in MemTable. But, how to do it automatically (read column names from CSV file, setup fields in memtables, etc.)?
0
me
10/29/2013 7:53:11 PM
embarcadero.delphi.firedac 822 articles. 2 followers. Follow

4 Replies
8617 Views

Similar Articles

[PageSpeed] 46

Hello

> I have managed MoveData to import data from CSV, but only if I prepare 
> fields in MemTable. But, how to do it automatically (read column names 
> from CSV file, setup fields in memtables, etc.)?

FDDataMove1.Destination := FDMemTable1;
FDDataMove1.SourceKind := skText;
FDDataMove1.TextFileName := '.......';
FDDataMove1.TextAnalyze := [taDelimSep, taHeader, taFields];
FDDataMove1.Execute;

-- 
With best regards,
Dmitry Arefiev / FireDAC Architect
FireDAC - Firebird, SQLite, MySQL, SQL Server, Oracle, PostgreSQL,
DB2, SQL Anywhere, Access, Informix, ODBC high-speed data access lib
1
Dmitry
10/30/2013 6:41:11 AM
Dmitry 

I was happy and surprised for simplicity of those commands (still undocumented?).

However, it seams that there is some bug. If I have fields of different types in CSV (3 x text fields and 1 integer field) then everything is ok. Fields are recognized and named according to first line in CSV, and data is imported.

But if I have 3 text fields in CSV like this: 
LOGINID;PERSONID;PASSWORDINPUT
manoel111;aaa;manoelpwd
manoel222;aaa;manoelpwd

Then in MemTable I get fields named FDMemTable1Field106 to 108 with imported data, and additional 6 fields with similar names with no data. First line ("LOGIN;..") is imported as data into first line (not recognized as column headers). Also data from first column is cut to "manoel1", other two columns are not cut. Best is to show it with photo. 

[IMG]http://i42.tinypic.com/2z4l3iv.png[/IMG]
0
me
10/30/2013 8:06:29 PM
> I was happy and surprised for simplicity of those commands (still 
> undocumented?).

Still not.

> First line ("LOGIN;..") is imported as data into first line (not 
> recognized as column headers).

Exclude taHeader. Otherwise FireDAC recognizes all
that as 3 data rows.

-- 
With best regards,
Dmitry Arefiev / FireDAC Architect
FireDAC - Firebird, SQLite, MySQL, SQL Server, Oracle, PostgreSQL,
DB2, SQL Anywhere, Access, Informix, ODBC high-speed data access lib
0
Dmitry
10/30/2013 9:10:28 PM
Super, thank you .. 

FireDac seams very powerful ..
0
me
10/30/2013 9:27:39 PM
Reply:

Similar Artilces:

FireDAC and Delphi Pro XE4... firedac tab not visible?
I am moving from a very old Borland product (2006) to Delphi XE4 Professional with FireDAC addon. I purchased both from Embarcadero, and have downloaded both. The documentation says the FireDAC components should automagically appear in the tabset for Delphi. They do not. I don't want to fool around too much as my environment is strictly controlled by IT, and they are very slow to do anything. Is there something that I should have done, but did not do? I installed XE4 first, registered it, then used the link in my email from Embarcadero to download the FireDAC components. Then I ra...

FireDAC for Delphi 2007 ?
Hello, I would like to know if FireDAC Client/Server Pack can be installed on Delphi 2007 pro. Thanks, Regards, Emmanuel Lion FireDAC Client/Server Pack for XE5 - No FireDAC Client/Server Pack for XE4/XE3, see: http://support.embarcadero.com/article/42970 M. E.L. wrote: > Hello, > > I would like to know if FireDAC Client/Server Pack > can be installed on Delphi 2007 pro. > > Thanks, > Regards, > > Emmanuel Lion > On 02.10.2013 18:17, quinn wildman wrote: > FireDAC Client/Server Pack for XE5 - No > FireDAC Client/Server Pack ...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source to remove this issue. To set the Param on NULL value before executing the query I do: {code} with qryExample.ParamByName('Example_id') do Begin DataType:=ftInteger; Clear; // Bound := True; End; {code} > {quote:title=Robert Triest wrote:}{quote} > To set the Param on NULL value before executing the query I do: >...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source to remove this issue. To set the Param on NULL value before executing the query I do: {code} with qryExample.ParamByName('Example_id') do Begin DataType:=ftInteger; Clear; // Bound := True; End; {code} > {quote:title=Robert Triest wrote:}{quote} > To set the Param on NULL value before executing the query I do: >...

FDDataMove from CSV to SQLite
FDDataMove does great from SQLite to CSV. The other way around it has problems recognizing dates and reals. I use the following: ShortDateFormat = m/d/yyyy (which is what's used in the CSV file) TextAnalyzeSample = 3000 (so FDDataMove goes deep enough into the CSV file import to realize that all numeric fields have to be real: fractional and possibly negative) And yet it persists at importing dates as VARCHAR (10) and reals as integers. I can get it to import reals by manually setting each numeric field in the first row as -0.5 but that seems silly (and impractical). What...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source ro remove this issue. I suggest to the FireDAC newgroup. You'll probably get a better response there. Sebastian Kumor wrote: > Hello, > I have FireDac components installed to Delphi Xe2, > My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. > It doesn't work. Mayb...

FireDac Delphi Xe2
Hello, I have FireDac components installed to Delphi Xe2, My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. It doesn't work. Maybe someone know what I have to change in FiredAc source ro remove this issue. I suggest to the FireDAC newgroup. You'll probably get a better response there. Sebastian Kumor wrote: > Hello, > I have FireDac components installed to Delphi Xe2, > My version of FireDac is 8.0.1 but in this version I have probelm with TAdoquery with StrsEmpty2Null param. > It doesn't work. Mayb...

FireDAC for Delphi Pro XE4
Hi, Being a Delphi Pro XE4 user with a valid FireDAC subscription, where can I download FireDAC for Delphi Pro XE4? Thanks, Luk Luk Smolders wrote: >Being a Delphi Pro XE4 user with a valid FireDAC subscription, where >can I download FireDAC for Delphi Pro XE4? I got mine from https://cc.embarcadero.com/item/29369 Cheers, Nick -- Sent from my XanaNews v1.19.1.373 > {quote:title=Nicholas Ring wrote:}{quote} > Luk Smolders wrote: > > >Being a Delphi Pro XE4 user with a valid FireDAC subscription, where > >can I download FireDAC for Delp...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

FireDac in Delphi XE5 Pro
Does FireDac in delphi xe5 Pro (without any add-ins) provide any useful functionality ? Based upon what I've read, it seems to offer an alternative (better)?) means to link to Access and MySQL when they are installed on the same PC. Pete K FireDAC does SQLite w/ encryption on Windows. Peter Kane wrote: > Does FireDac in delphi xe5 Pro (without any add-ins) provide any > useful functionality ? Based upon what I've read, it seems to offer > an alternative (better)?) means to link to Access and MySQL when they > are installed on the same PC. > > Pete...

Firedac for Delphi XE Pro
Will the XE4 Client Server Pack for FireDac work properly with Delphi XE Professional? Will that provide the full Firedac functionality or is it limited? Is it dependent on functionality in the Enterprise product which is not in the Professional? And finally, will I have the license rights to market and sell the application I create? I understand it does not require dbexpress which has certain restrictions, correct? I would like to be able to evaluate it in an XE environment without upgrading everything just to try and work with it. Patrick Moloney wrote: > Will the XE4 Client Serve...

FireDAC XE5 with Delphi XE
I have Delphi Enterprise XE5 and XE, and use both for various projects. Is it possible to use the new FireDAC that comes with XE5 (v9.x I believe) with Delphi Enterprise XE? If so, how do I obtain the standalone FireDAC XE5 installer? I have an active RAD Studio Enterprise software assurance plan. I've looked for FireDAC XE5 in my registered users download section, but I can't find anything for FireDAC XE5. I can only find downloads for FireDAC XE4. Regards, -Kevin Hello Kevin > Is it possible to use the new FireDAC that comes with XE5 (v9.x I > believe) wi...

Delphi FireDAC SQLite RecNo = -1
RecNo for a FireDAC FDTable in an SQLite database equals -1 even though the cursor is on the last of 1,200,000 records. What is that all about? http://docwiki.embarcadero.com/Libraries/XE7/en/FireDAC.Stan.Option.TFDFetchOptions.LiveWindowParanoic -- With best regards, Dmitry Arefiev / FireDAC Architect ...

FireDac Update 1 on Delphi XE4
Ok, I was able to download FireDac on our Mac and at home, so it seems that I can't download update 1 on our regular computers. However, am I mistaken when I say that there is no way to install the new FireDac update into Delphi XE4? If you use the showide parameter, Delphi XE4 will not show up. Thanks > {quote:title=Phillip Woon wrote:}{quote} > Ok, I was able to download FireDac on our Mac and at home, so it seems that I can't download update 1 on our regular computers. > > However, am I mistaken when I say that there is no way to install the new FireDac upd...

Web resources about - FDDataMove CSV to FDMemTable1 - embarcadero.delphi.firedac

Resources last updated: 2/10/2016 7:24:48 PM