need to drop header records during import of TXT file

Randy

Registered User.
Local time
Today, 17:05
Joined
Aug 2, 2002
Messages
94
simple table 6 columns
startdate
enddate
custacct
salescost
salesprice
salesqty

the txt file is set up so that there is a header record, 4,999 lines of data, then the same header record, then 4,999 lines of data, then a header record etc etc. for as many lines as is in the download. This is a download TXT file from a Microsoft Axapta ERP system.

I have my table all set up and during the import I want the header records to be dropped.

I tried in the validation section for startdate {Not "startdate"} but that did not work.

Is there some simple way to ensure the header records are dropped?
 
I would do the import into a temporary table, and then write a parser that reads and cleans the data, and puts it where to goes.
 
you can't delete the records on import

you can bring them into an initial staging table, then delete the header rows with a "safe method" that you know does not delete any real data.

currentdb.execute "delete * from stagingtable where somecolumn = " & somevalue

then you can do any other validation checks you need, and finally add them to the real data table with an append query.
 

Users who are viewing this thread

Back
Top Bottom