Jump to content
Serge_G

"filtering" FDBatchmove

Recommended Posts

Hi,

 

The goal, I have a text file with words and I want to export in a FDMemTable words with length between 4 and 12 ?

I don't know how to get the value in onWriteRecord event, is there a way to ?

I can get the value in the OnWriteValue one but fired after onWriteRecord it's unusefull.

 

Any hints (not involving a localsql DELETE)

Share this post


Link to post

OK, found it! I need mappings and then my "filter" works

procedure TDataModule2.FDBatchMove1WriteRecord(ASender: TObject;
  var AAction: TFDBatchMoveAction);
var m : String;
begin
AAction:=TFDBatchMoveAction.paInsert;
m:=FDBatchmove1.Mappings[0].ItemValue;
accept:=(Length(m)>=4) AND (Length(m)<=12);
if not Accept then AAction:=TFDBatchMoveAction.paSkip;
end;

My file text need a first line =column definition. I just have an encoding problem to solve (attached my file) 

and as you can see on image I have some problems  like these zygopétale, zygopétales

 

 

liste_de_mots.francais.frgut.txt

Capture.PNG

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×