I don't know what your data looks like or what table you're trying to populate - but if you import your data into variables you can use
Testfield := copystr("first field",1,1);
if testfield = 7 then begin
map your variables to nav fields
end else begin
currdataport.skip;
end;
As I said - Create variables as substitues for the fields you want to import your data to.
if the fields you want to import are called
CODE
NO
ZIP
then for example - create
importedCODE
importedNO
ImportedZIP
FieldCheck
enter these variables into your dataport fields not the real nav fields.
Onafterimport trigger
fieldcheck := copystr("importedCode",1,1);
if fieldcheck = '7' then begin
validate(code,importedcode);
validate(no,importedno);
validate(zip,importedzip);
end else begin
currdataport.skip;
end;
if you import into variable nothing gets put into your nav table until you map it to its corresponding nav field. good luck!
you could always open your file in excel - sort it & delete all the lines that don't start with 7 & then save it back to csv - but that's no fun!
Answers
I don't know what your data looks like or what table you're trying to populate - but if you import your data into variables you can use
Testfield := copystr("first field",1,1);
if testfield = 7 then begin
map your variables to nav fields
end else begin
currdataport.skip;
end;
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thank you for your reply.
Sorry, I could n't explain properly. As I have .CSV file, having data. All character and Numeric.
I need to import only starting lines with 7.
in my data file, other lines starts with 1 or 2 and other numbers. But import only line starting with 7.
before insert only, I would like to check, and insert only line starting with 7.
as other lines having more numeric data, so I am getting errors.
here I need to read the data file, before insert.
if the fields you want to import are called
CODE
NO
ZIP
then for example - create
importedCODE
importedNO
ImportedZIP
FieldCheck
enter these variables into your dataport fields not the real nav fields.
Onafterimport trigger
if you import into variable nothing gets put into your nav table until you map it to its corresponding nav field. good luck!
you could always open your file in excel - sort it & delete all the lines that don't start with 7 & then save it back to csv - but that's no fun!
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks a lot for detailed explanation.
Great!!