Need Help Importing a DDF File

Gurn

Registered User.
Local time
Today, 05:57
Joined
May 6, 2004
Messages
12
I need some help importing a DDF file into a table... The file looks something like this:
|
3000

0000


5005B
177.033

5025
5.089

5026
4.000

5028
3.040

5035B
330.739

5044
338.538

5046B
160.001

5135S
387.988

5320B
360.736

5031S
237.837

|
These would be 2 different fields (1)Product Number and (2) weight I have no idea how to seperate by the return and filter out the blank space...
Any help would be appreciated greatly!!!!!!!!
Thanks,
gurn :confused:
 
Gurn,

In the long run, it would help if you inherited data
in a better format, but sometimes you have to go with
what you have.

Hope this gets you started.

Code:
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim strBuf As String

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("YourTable")
Open "C:\SomeFile.dat" For Input As #1

Line Input #1, strBuf
While Not EOF(1)
   rst.AddNew
   Line Input #1, rst!Product
   Line Input #1, rst!Weight
   rst.Update
   Line Input #1, strBuf <-- Ignore white space
   Wend
Close #1

Wayne
 
Yup that was the right direction Thanks!!!!!
gurn
 

Users who are viewing this thread

Back
Top Bottom