Link to home
Start Free TrialLog in
Avatar of Dreamslogic
Dreamslogic

asked on

Batch file path issue - URGENT

Hi there,

Thanks once again.

Issue is my PLUSales files are inside the StoreFiles(Directory).  IMy Productcatalog is working fine but PLUSale need some changes

FileSystem Struture:
 
StoreFiles(Directory) --> ProdcutCatalog.csv
StoreFiles(Directory) --> PLUSales(Folder1) --> PLUSales1.csv
StoreFiles(Directory) --> PLUSales(Folder2) --> PLUSales3.csv
StoreFiles(Directory) --> PLUSales(Folder2) --> PLUSales4.csv

Solution Required:

OsPos(Directory) --> BUNDABERG (With all Zipped files in this folder)


Script:
 
set SSIS_FTPFILE_ORG=I:\Information Technology\Retail\Durga\OsPos\Store Files\
set SSIS_FTPFILE_DEST=I:\Information Technology\Retail\Durga\OsPos
set LOGFILE=%SSIS_FTPFILE_DEST%zbatlog%curdate%.txt
 
 
"C:\Program Files\7-zip\7z.exe" a "%SSIS_FTPFILE_DEST%\BUNDABERG.zip" "%SSIS_FTPFILE_ORG%\ProductCatalog*.csv" >>"%LOGFILE%"
"C:\Program Files\7-zip\7z.exe" a "%SSIS_FTPFILE_DEST%\BUNDABERG.zip" "%SSIS_FTPFILE_ORG%\..\PluSales*.csv" >>"%LOGFILE%


Please help me its urgent

Thanks,



Thanks for the help,

D
Avatar of 013gonzo
013gonzo

Hi

According to 7-zip command & switches you must enter "-r0" switch to include "Enable recurse subdirectories only for wildcard names".
Try it and please let me know is it ok or not on my mail address.
ASKER CERTIFIED SOLUTION
Avatar of Jerry Miller
Jerry Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dreamslogic

ASKER

Hi there,

No its not woking, it doesn't do anything. Below is my file struture. I used wild card with 'a' and without 'a' command. Also -r0 command still doesn't work. Any idea. I need to ZIP 40 to 100 GB of data over night. It's urgent any help much appreciated.

FileSystem Struture:
 
StoreFiles(Directory) --> ProdcutCatalog.csv
StoreFiles(Directory) --> PLUSales(Folder1) --> PLUSales1.csv
StoreFiles(Directory) --> PLUSales(Folder2) --> PLUSales3.csv
StoreFiles(Directory) --> PLUSales(Folder2) --> PLUSales4.csv
Hi JMiller,

I made changes as you mentioned above but it takes whole subfolder and zip with main. I just need the file inside the subfoler.

BUNDABERG.zip contains subfolder and ProductCatalogfiles.

FileSystem Struture:
 
StoreFiles(Directory) --> ProdcutCatalog.csv
StoreFiles(Directory) --> PLUSales(Folder1) --> PLUSales1.csv
StoreFiles(Directory) --> PLUSales(Folder2) --> PLUSales3.csv
StoreFiles(Directory) --> PLUSales(Folder2) --> PLUSales4.csv
Solution Required:

OsPos(Directory) --> BUNDABERG (With all Zipped files in this folder) both ProductCatalog and PLUSales

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks again,

My SSIS package creates exactly same as you mentioned above but my task it to get those files into one place. so from there again SSIS package runs and load all the records into fact table.

I will wait for you, can you please let me know the wildcard version for folders instead of files.

Sorry to being pain, but this is bit critical to load. Please help me out.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
But to be honest with you, I got 350 subfolders and all the subfolders got PLUSales.csv files. I need to get them into BUNDABERG.zip along with ProductCatalog.csv. - This is for only BUNDABERG site and I got 190 sites all this

You mean to say I need to write 350 times for each subfolder.

Any Idea we can dynamically change that control it. This is really driving me crazy.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much for your time. However, above script didn't help. It will move the whole folder instead of file. I have to sit whole night now, extract each file and place it in a folder and load into fact table.

Sorry mate !!

Thanks for your help, some tiems it  doesn't go our way !! :(



User is very helpful. We both tried ,probably someone can you the code.
But I appreciate his input.
When I tested it, (the -ir! switch) I only pulled in the files that were *.csv and not the folder.

If you are moving all of them anyway, you may as well use the script to zip them up and save yourself some time. Dump them in a folder and change the origin to that folder.

You're right, sometimes this 'stuff' doesn't go our way, but it irritates me to death to not find a solution. Especially if it costs someone else a bunch of time. I sit in front of a keyboard many hours in a day by choice (at work and at home), but I try to free up someone else that wants to get away.