dbTalk Databases Forums  

Re: importing text with headers

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Re: importing text with headers in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: importing text with headers - 07-03-2003 , 03:30 PM






What you could do is clean the files so

1. Strip out the data to a seperate file
2. Place data file in a directory

You now have two files for each original source file.

You can loop through the data files using this

Looping, Importing and Archiving
http://www.sqldts.com/default.aspx?6,103,246,0,1

You would then need to build a routine to import the header files

You need the DTS dlls to use DTS (Ideally)

Redistributing DTS with your program
http://www.sqldts.com/default.aspx?6,105,225,0,1

--


Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

"Lori Brassell" <lori.brassell (AT) nist (DOT) gov> wrote

Quote:
I'm new to DTS and my problem is probably pretty
standard. I have several thousand data files generated by
a proprietary lab instrument (tab-delimited text) that I
want to import into an SQL 2000 database with an MS Access
Project (*.adp file) front-end. Each file has about 59
rows of header text that I also want imported into a
separate table in the database.

The format looks something like this:
FILE: c:\testdata
-------------------------
---Test Parameters-------

Test Date: 20-Mar-00 Test Time: 02:08 p.m. Operator: John
Smith

Number of Scans: etc....

...
Scan, Time, Etc..
1,0,...
2,1,...

I know I can skip the first 59 rows to import the
delimited data (like importing text in MS Access), but I
need the header data as well.

I think I know I need to develop an Active X Task to
customize the import, but I don't know how. And how do I
run a DTS Package through an Access Project?

Also, more files are constantly being generated so I'd
like to be able to regularly schedule the import of new
files as well as be able to go and specifically select a
file to import through the Access Project application.

Any help would be greatly appreciated. Thanks in advance!

Lori



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.