locked
unzip multiple files from folders to main folder RRS feed

  • Question

  • Hi All,

    I have main folder path as \\server\data\intake in this folder i have multiple folders like

    \\server\data\intake\AB,

    \\server\data\intake\CD etc.

    Inside each these folder i have zip folders \\server\data\intake\AB\Claims Data.zip 

    I want to unzip this folder and get all the files from the root folder to main folder. 
    Also suppose in the claim Data.zip i might have folder with name like Y2017M04 make it sense to have the files for the particular year-month,
    Before unziping the files from this folder i need to add this folder name to the end of file name.

    I do not want to use 7zip to unzip the files, what is other way to do this?

    Thanks,

     


    Dilip Patil..

    Wednesday, June 14, 2017 11:24 AM

All replies

  • You can use this method if you don't want to use an external .exe.

    http://lakshmana-msbi.blogspot.com/2015/12/ssis-extract-files-from-zip-files-and.html

    http://sqlblog.com/blogs/jorg_klein/archive/2009/08/27/ssis-unpack-a-zip-file-with-the-script-task.aspx

    Wednesday, June 14, 2017 12:10 PM
  • Thanks Tom,

    implemented the same and After running getting errors

    Am i missing anything?

       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()


    Dilip Patil..

    Wednesday, June 14, 2017 1:39 PM
  • Hi Danaffrod,

    Please share the error description message.

    Thanks,

    Pirlo Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, June 14, 2017 4:10 PM
  • Thanks Pirlo,

    Actually the problem is that suppose for one of my subfolder

    \\server\data\intake\AB\Claims Data.zip\br\dyt\y2017m04\Bdual

    this is the full file path, but as it just not going after \Claims Data.zip because it is not finding as windows folder.

    Means, to unzip the file to main folder , i have to unzip the folder first or something similar

    Please ask if any doubts.

     


    Dilip Patil..

    Wednesday, June 14, 2017 5:59 PM
  • Hi Dannaffrod,

    Could you try to unzip the Cliams Data.zip file to a folder with the specific UNC path first, then continue processing the folder with the path?

    Regards,

    Pirlo Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Sunday, July 2, 2017 3:57 PM
  • Friday, April 20, 2018 2:05 PM