dbTalk Databases Forums  

insert/transform data from text files

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


Discuss insert/transform data from text files in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
matthew c. harad
 
Posts: n/a

Default insert/transform data from text files - 12-04-2003 , 01:51 PM






hello,

i am trying to do the following:

i have a folder full of text files. each text file
contains a list of records. each record represents one
day of price/volume data for a stock (date, open, high,
low, close, up volume, down volume). each text file is a
set of records for one stock -- the stock symbol is not in
the body of the text file. instead it is included in the
name of the file: <ticker symbol>.txt

i need to:

loop through all these files:
1) figure out what ticker the data is for,

2) retrieve the appropriate StockID for that ticker,

3) perform some minor transformations on the data
(e.g. add the up volume and down volume columns into one
total column),

4) write the data to my historical price table in the
database.

any suggestions as to the best way to go about this?

i've started to look at DTS but am feeling like i will
have to learn a bunch (vbscript, dts object model maybe)
and am feeling overwhelmed -- if that is the best way to
do it though, then i will.

much thanks!

matt

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: insert/transform data from text files - 12-04-2003 , 02:04 PM






OK

Minor adjustments to this article.

Looping, Importing and Archiving
(http://www.sqldts.com/default.aspx?246)


You can perform a lookup in an ExecuteSQL task that returns to a Global
Variable the value of the StockID from the partial text file name.
You pass this into a Global Variable and you can then use it in any ActiveX
transform in the package.




--
--

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

"matthew c. harad" <mharad (AT) artoriusfunds (DOT) com> wrote

Quote:
hello,

i am trying to do the following:

i have a folder full of text files. each text file
contains a list of records. each record represents one
day of price/volume data for a stock (date, open, high,
low, close, up volume, down volume). each text file is a
set of records for one stock -- the stock symbol is not in
the body of the text file. instead it is included in the
name of the file: <ticker symbol>.txt

i need to:

loop through all these files:
1) figure out what ticker the data is for,

2) retrieve the appropriate StockID for that ticker,

3) perform some minor transformations on the data
(e.g. add the up volume and down volume columns into one
total column),

4) write the data to my historical price table in the
database.

any suggestions as to the best way to go about this?

i've started to look at DTS but am feeling like i will
have to learn a bunch (vbscript, dts object model maybe)
and am feeling overwhelmed -- if that is the best way to
do it though, then i will.

much thanks!

matt



Reply With Quote
  #3  
Old   
matthew harad
 
Posts: n/a

Default insert/transform data from text files -- re: reply - 12-09-2003 , 10:44 AM



re: your reply.

thank you for the complete answer. i checked out your
site and it looks cool. for now i have wimped out and
written a few procedures in vba which work ok. i may
reimplement it in dts later.

appreciated,
matthew


Quote:
-----Original Message-----
hello,

i am trying to do the following:

i have a folder full of text files. each text file
contains a list of records. each record represents one
day of price/volume data for a stock (date, open, high,
low, close, up volume, down volume). each text file is a
set of records for one stock -- the stock symbol is not
in
the body of the text file. instead it is included in the
name of the file: <ticker symbol>.txt

i need to:

loop through all these files:
1) figure out what ticker the data is for,

2) retrieve the appropriate StockID for that ticker,

3) perform some minor transformations on the data
(e.g. add the up volume and down volume columns into one
total column),

4) write the data to my historical price table in
the
database.

any suggestions as to the best way to go about this?

i've started to look at DTS but am feeling like i will
have to learn a bunch (vbscript, dts object model maybe)
and am feeling overwhelmed -- if that is the best way to
do it though, then i will.

much thanks!

matt
.


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.