PDA

View Full Version : Solved: Parse a text file



majaro
02-15-2008, 06:07 PM
I have thought of a few ways to do this but would like to get some other ideas.

I have to download a text file using an APPEND query evey month into an existing table. The problem is that it comes over with incomplete fields (ones that are blank). I want to find a way to take any record that has a blank field and write it to an exception table and the complete records to the main table.

One approach I thought of was to first parse it to Excel, massage the data to 2 different worksheets then load the Access tables. However, that's an extra step I would like to avoid.

I was hoping for some ideas from the great minds on this board.

asingh
02-15-2008, 07:41 PM
Hi,

Append all the data..including the data into two separate tables. One for correct data and one for exception.

SELECT * from TableSource where Field_name is NULL;

majaro
02-15-2008, 07:47 PM
Huh?

asingh
02-15-2008, 07:50 PM
Basically you create two separate queries...based off your source table.

1. For correct data..where your inspected fields are NOT null.
2. For incorrect data..wher your inspected fields are null.

Append the output of 1 and 2..into separate tables...for incorrect data..and correct data..!!

regards,

asingh