dbTalk Databases Forums  

How to cleanse a data file like this in DTS

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


Discuss How to cleanse a data file like this in DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Karen Middleton
 
Posts: n/a

Default How to cleanse a data file like this in DTS - 03-17-2005 , 05:17 AM






Hello All

I get the following data file which as some page headers and column
headers I need to get rid of the page headers and column headers and
read only the columns of data please provide me with a sample VB
script code that can accomplish the cleaning.

The file structure is as follows:


10:12 PM 02-2005 XYZ Com Ltd.
34715 ABC CO 15-Mar-05
New York :NIGHTM VENDOR
SALES ANALYSIS
PAGE 1

------Net Sales------ ------Whse Stock----- -----Other
Sales-----
Customer CUR YTD CUR YTD CUR
YTD
---------- ---------- ---------- ---------- ---------- ----------
----------
102509 53 53
102582 16 16 16 16
10770632 157 32 157



In the above file all I need is the following data:

102509 53 53
102582 16 16 16 16
10770632 157 32 157


the rest must be removed sometimes the report is so big multiple pages
could appear each with a page header please advise the best way of
handling and cleansing this kind of data and picking up only things
needed and discarding the unwanted data.

Please share the VB script code how to cleanse in the above form.

Thanks
Karen

Reply With Quote
  #2  
Old   
Simon Worth
 
Posts: n/a

Default Re: How to cleanse a data file like this in DTS - 03-17-2005 , 08:25 AM






If the structure is always the same then you can skip the first 3 lines that
you don't need by going to the data file connection, and clicking
properties. Then enter the number of lines you want to skip in there.

--
Simon Worth


"Karen Middleton" <karenmiddleol (AT) yahoo (DOT) com> wrote

Quote:
Hello All

I get the following data file which as some page headers and column
headers I need to get rid of the page headers and column headers and
read only the columns of data please provide me with a sample VB
script code that can accomplish the cleaning.

The file structure is as follows:


10:12 PM 02-2005 XYZ Com Ltd.
34715 ABC CO 15-Mar-05
New York :NIGHTM VENDOR
SALES ANALYSIS
PAGE 1

------Net Sales------ ------Whse Stock----- -----Other
Sales-----
Customer CUR YTD CUR YTD CUR
YTD
---------- ---------- ---------- ---------- ---------- ----------
----------
102509 53 53
102582 16 16 16 16
10770632 157 32 157



In the above file all I need is the following data:

102509 53 53
102582 16 16 16 16
10770632 157 32 157


the rest must be removed sometimes the report is so big multiple pages
could appear each with a page header please advise the best way of
handling and cleansing this kind of data and picking up only things
needed and discarding the unwanted data.

Please share the VB script code how to cleanse in the above form.

Thanks
Karen



Reply With Quote
  #3  
Old   
Karen Middleton
 
Posts: n/a

Default Re: How to cleanse a data file like this in DTS - 03-17-2005 , 03:44 PM



"Simon Worth" <REMOVEFIRST_simon.worth (AT) gmail (DOT) com> wrote

Quote:
If the structure is always the same then you can skip the first 3 lines that
you don't need by going to the data file connection, and clicking
properties. Then enter the number of lines you want to skip in there.

--
Simon Worth
Simon

Thanks for the tip. I know I can use a simple skip lines in DTS
perhaps that alone will not suffice since as I said this is a text
report generated from a legacy system so inbetween in the report there
are page headers and page numbers I want to eliminate all this and
want to pick only certain columns in the file for import into SQL.

Any help is appreciated.

Thanks
Karen


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.