-
Notifications
You must be signed in to change notification settings - Fork 0
Extract, archive and trigger completion file
papakillo edited this page Nov 1, 2023
·
2 revisions
The provided script appears to perform a series of file-related operations, including locating, extracting, archiving, and triggering completion of a data processing task. Below is an explanation of the script. Please replace names of folders with your own names.
`for /R "\adub\na" %%I in ("sales**.zip") do ( "C:\Program Files\7-Zip\7z.exe" x -y -o"C:\Wherescape\inbound\data\EU_FILES\sales" "%%~fI" )
move \adub\na\sales_*.zip \adub\eu_folder_Archive\
echo 1 > C:\Wherescape\inbound\data\NA_FILES\sales\complete.trg`
-
Commented Description:
- The initial comment lines describe the purpose of the script, indicating it searches the "NA1010" folder for ZIP files matching the pattern "CEU_SALES*.zip".
-
For Loop with 7-Zip Extraction:
- It uses a
forloop to traverse the directory "\hefsarc01\na1010" and identifies all ZIP files matching the pattern "CEU_SALES*.zip". - For each matched ZIP file (
%%I), the script utilizes 7-Zip ("C:\Program Files\7-Zip\7z.exe") to extract the files (xcommand) into the directory "C:\Wherescape\inbound\data\EU_FILES\CEU_SALES". -
%%~fIrepresents the full path of the current ZIP file being processed.
- It uses a
-
Move Command:
- After extraction, the script uses the
movecommand to relocate the extracted ZIP files matching the pattern "CEU_SALES_*.zip" from the original directory to the archive directory "\hefsarc01\EU1010_Archive".
- After extraction, the script uses the
-
Trigger File Generation:
- Finally, it creates a trigger file named "complete.trg" in the directory "C:\Wherescape\inbound\data\NA_FILES\CEU_SALES". The file content is "1", serving as a signal or indicator of the completion of the process.