For each loop container not working as expected (only reads the first file)

  • Check the Files text area..(have provided any delimiter or any specific extension)

    Chek the status of Traverse Sub Folders checkbox

    Raunak J

  • Raunak Jhawar (8/25/2010)


    Check the Files text area..(have provided any delimiter or any specific extension)

    Chek the status of Traverse Sub Folders checkbox

    Traverse sub folders has no affect on the root folder.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Alvin,

    If the package is just reading the a single file then definately the remaining files must be in a folder structure.

    Raunak J

  • Raunak Jhawar (8/25/2010)


    Alvin,

    If the package is just reading the a single file then definately the remaining files must be in a folder structure.

    The original post contains the following:

    I Configured a For each loop container in order to read each of the files from a FOLDER and then process them using Data Flow/Script Component but is only reading ONE file from the folder.

    hence Alvin's sensible message.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil,

    What do you suppose is the problem?

    Raunak J

  • It's a puzzle that would probably be sorted out within five minutes if an experienced SSIS user had direct access to the package. I have nothing specific to add that has not already been suggested. I'm sure it will be something minor.

    But one thing I try not to do is treat the OP in a patronising way by suggesting that the facts stated in their original post are actually incorrect.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin (8/25/2010)


    It's a puzzle that would probably be sorted out within five minutes if an experienced SSIS user had direct access to the package. I have nothing specific to add that has not already been suggested. I'm sure it will be something minor.

    But one thing I try not to do is treat the OP in a patronising way by suggesting that the facts stated in their original post are actually incorrect.

    Well said. We'll just have to wait to the OP to reply or perhaps post his package so we can troubleshoot.

  • Even If a test selecting "Trasverse Folders"I get the same result, only one files is read.

    My Enumerator configuration:

    Folder: C:\txtSalida\PlantasR42

    Files: *.txt (have tried already using *.*,*test.txt)

    Files inside this folder are:

    Test5.txt

    Testing.txt

    Variable Mappings":

    User::FIlename

    Expressions: No Expressions.

    Only Testing File is showed in the pop up messagebox.

    If I delete Testing file, then TEST5.txt is read.

    -----------------------------------------------------

    DataFlow:

    Script Component:

    Readonly variable= User::FileName

  • Please it would be great if you can see directly my package in my computer.

    Let me know if anyone can so I can send you a link.

  • Can you post the package?

  • I don't see anything wrong.

    Try this:

    1 - Add a new For Each Loop to the package and configure it to read the same files. (DO NOT use copy and paste!!!)

    2 - Add a VB Script task in this new container and have it display the file name using a MsgBox.

    If this works, I'm guessing that the original For Each container was somehow corrupted or there's an issue with the tasks in the original container. if this worked then try adding the original tasks to this new container and delete the old one.

    If this does not work, then ....... good question.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • What's the scope of your User:filename? I've had bad results by not paying attention to that.

    (edit) needs to be within the loop, and not a package-wide var.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Thanks!! for all your help. I could not figure out the problem and I did not have much time, so I found another way (workaround) to do the package.

    Also a friend of mine who is an SSIS expert tried to figure out the cause of the problem without success, it looks like it was a bug.

    I am succesfully using a FOR EACH container, but not the same way.

    thanks again to all for your help!

  • Matt!

    I think the variable User::FileName is set to be used all over the package.

    Idid not see your replays and I already found a workaround. I am going to check that just to know and let you know if that solve it!!!!!

    I can't even plan!! cause I am new in this!! first time using a Script Component. but it is good to know you are not the loud-spoken end user or the project manager!! LOL

    Thanks!!!!

  • Thanks Alvin

    I already found another way to do it. But I am still wondering what was wrong.

    Your suggestions sound very reasonable about that maybe the container is corrupted. I will try to find some time to try the things you just posted and let you know.

    Thanks a lot for your help I really aprecciate it.

    Regards,

    ana

Viewing 15 posts - 16 through 30 (of 33 total)

You must be logged in to reply to this topic. Login to reply