none
Wildcard name in Inputfile name

    Question

  • Hi,

    I am trying to use an input file which will always starts with the 'Poll'

    so i tried to use the following expression for the connection string to Flat File source to use that file as input.

    @[User::FilePath] + "Poll*.txt" 

    But this seems not working.

    how to use wild card names in Flat file source.

    Thanks!


    --------------------------- Radhai Krish | Golden Age is no more far | --------------------------

    Friday, November 23, 2012 11:56 AM

Answers

  • To make a connection manager dynamic, you need to replace its connectionstring with an expression. If you don't know the name then you need a Foreach Loop or a Script Task to get the name.


    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter

    • Marked as answer by Eileen Zhao Friday, November 30, 2012 7:30 AM
    Monday, November 26, 2012 7:39 AM

All replies

  • You need to use a For Each Loop in your control flow to loop through all the files that match your mask and then put your data flow inside the loop control.  Your Flat File source will then use the variable populated by the For Each Loop as the connection string.

    There are some examples here:

    http://consultingblogs.emc.com/jamiethomson/archive/2005/05/30/1489.aspx

    For others just google - ssis for each file


    Chuck Pedretti | Magenic – North Region | magenic.com

    Friday, November 23, 2012 12:56 PM
  • You need to drag For each loop

    In enumerator configuration give the path to the source

    Then in File say .TXT and reterive file name  click name and extension

    drag a scrip task in ur for each loop as a dummy source so u can draw presendence contraint

    bring ur data flow the in presendence contraint Expression and contraint- on success- SUBSTRING(@filepath,1,4)=="Poll"

    Logical and all


    Please mark as helpful and propose as answer if you find this as correct!!! Thanks,Miss Never Giveup .

    Friday, November 23, 2012 3:44 PM
  • Go fot the Foreach loop like mentioned above. Here is an other example.


    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter

    Friday, November 23, 2012 7:29 PM
  • Hi All,

    Actually i am having a DFT with 2 .txt Flat file source, and a Merge join to merge the records and so on for a project need.

    Here one of the .txt file alone needs to get by the starting name where as the next one will have the same file name all time.

    So I cant use that For each loop for my task. Also i've already thought about it.

    To get some other better workaround i came here ..

    Isn't there a solution other than the FOr each loop please let me know??

    Thanks !!


    --------------------------- Radhai Krish | Golden Age is no more far | --------------------------

    Monday, November 26, 2012 4:02 AM
  • To make a connection manager dynamic, you need to replace its connectionstring with an expression. If you don't know the name then you need a Foreach Loop or a Script Task to get the name.


    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter

    • Marked as answer by Eileen Zhao Friday, November 30, 2012 7:30 AM
    Monday, November 26, 2012 7:39 AM