- martin
Post a reply
Topic review
- turner14466@gmail.com
A More Efficient File upload script using WIldcard/Switches?
From a WinSCP newbie: I have an existing script (see snippet below) that auto-uploads .CSV files from 5 diff. local subdirs off the PORT dir to an identical dir-subdir set-up on the server.
Existing (Inefficient) Script Code Snippet:
Q. Is there a more efficient way to structure the code (snippet) below? – as I have about 100 such dir uploads like
Existing (Inefficient) Script Code Snippet:
# -------------------------------------------------- PORT dir
lcd C:\web\MEF_BATCH\OUT\csv_scen\PORT\cen
cd /risknz.mef-uk.com/csv_scen/sf_2023Q1/PORT/cen
put *.CSV
lcd C:\web\MEF_BATCH\OUT\csv_scen\PORT\sf1
cd /risknz.mef-uk.com/csv_scen/sf_2023Q1/PORT/sf1
put *.CSV
lcd C:\web\MEF_BATCH\OUT\csv_scen\PORT\sf2
cd /risknz.mef-uk.com/csv_scen/sf_2023Q1/PORT/sf2
put *.CSV
lcd C:\web\MEF_BATCH\OUT\csv_scen\PORT\sf3
cd /risknz.mef-uk.com/csv_scen/sf_2023Q1/PORT/sf3
put *.CSV
lcd C:\web\MEF_BATCH\OUT\csv_scen\PORT\sf4
cd /risknz.mef-uk.com/csv_scen/sf_2023Q1/PORT/sf4
put *.CSV
Q. Is there a more efficient way to structure the code (snippet) below? – as I have about 100 such dir uploads like
PORT
to perform eg could the code snippet be reduced to only 3 lines with a smart use of wildcards & switches etc??? From my reading of docs, suspect the answer maybe "no" (?) but maybe I missed something.