Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

SSIS scenarios...
Browse by Tags · View All
MSBI 30
SSIS 27
BRH 15
SQL Server 15
#BI 14
Script Component 9
#SQLSERVER 8
#SQL Server 7
Flat File Source 5
Script Component Source 5

Archive · View All
August 2010 4
March 2011 3
September 2010 3
February 2013 2
June 2011 2
November 2010 2
May 2010 2
November 2009 2
March 2010 2
May 2012 1

BI Quiz - Select distinct files from a list of files in a folder

Jun 2 2011 3:03AM by Sudeep Raj   

Scenario: You need to select files based on the uniqueness of a part of the file name.

Lets say the format of the file is:

XXXX_MMDDYYYY_garbage.csv

Where XXXX is of 4 characters, MMDDYYYY is the date in the format MMDDYYYY, <garbage> is any set of legal characters.

In the INPUT folder we have files like:

A001_01012011_xyz.csv
A001_01012011_xyz123.csv
A001_01012011_xsyz456.csv

A001_01022011_xyz.csv
A001_01022011_xyz123.csv
A001_01022011_xsyz456.csv

A002_01012011_xyz.csv
A002_01012011_xyz123.csv
A002_01012011_xsyz456.csv

A002_01022011_xyz.csv
A002_01022011_xyz123.csv
A002_01022011_xsyz456.csv

A002_01032011_xyz.csv
A002_01032011_xyz123.csv
A002_01032011_xsyz456.csv

In the output folder we need to get the following files with the specified naming convention and the data in all the files in one group is the same, so you could copy the data of any file in the group. Remove the garbage part from the file name and have one file from each group processed. Grouping is done based on the file name parts XXXX & MMDDYYYY.  The output file names should be like the once mentioned below for the above scenario.

A001_01012011.csv
A001_
01022011.csv
A002_01012011.csv
A002_
01022011.csv
A002_01032011.csv

So tell me how would you design the SSIS package for this scenario and provide the design you feel will be most efficient.

Note: Use of Script Task is not allowed.

Click Here to Submit an Answer

Tags: MSBI, SSS, BI Quiz,


Sudeep Raj
12 · 13% · 4303
2
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

2  Comments  

  • Please follow the steps below:

    1. Read content of Folder(file names ) using ForEach loop.
    2. Assign result of foreach to Variable (File name) in 2 Variables, 1 for back up purpose.
    3. Put Script Task in ForEach. Open file Read Text or Binary content (if file is .csv then read as text). Assign it to variable or save as temp.
    4. Iterate next value. Check file name if only garbage is different attach the file content to Prev. read file else save the prev loaded file as output location.
    commented on Jun 6 2011 12:03AM
    Alpesh Patel
    36 · 5% · 1663
  • Hi Alpesh, Thanks for your answer. Request you to post the answer here: http://beyondrelational.com/quiz/sqlserver/bi/2011/questions/ssis-select-distinct-files-from-folder-based-on-certain-conditions.aspx

    commented on Jun 6 2011 12:11AM
    Sudeep Raj
    12 · 13% · 4303

Your Comment


Sign Up or Login to post a comment.

"BI Quiz - Select distinct files from a list of files in a folder" rated 5 out of 5 by 2 readers
BI Quiz - Select distinct files from a list of files in a folder , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]