Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1083
  • Last Modified:

Batch File that list directories with a line of space between each directory

The excellent code below was sent to me by mpfister, and it basically lists down the directory name and the reports that were uploaded to that particular directory. The output would look like this:

PO301001
CTPD540_PAL
CTPD550_PAL
CTPD810_PAL
PO302001
CTPD540_CMF
CTPD550_CMF
CTPD810_CMF

1. I need help in rectifying this batch file so that it leaves a line between directories.
2. I also need help in rectifying this batch file that it accepts the full report name. (example: CTPD540_PAL-_20050516 Cross_List_Report_20050516, CTPD960_200505, CTPD971_20050516)
3. I also need help in rectifying this Batch file that it accepts directory names that not only begin with the alphabet "P" but also with "E" or "L". It SHOULD NOT read just the first alphabet but at least the first three characters.

For example it should be:

PO301001
CTPD540_PAL
CTPD550_PAL
CTPD810_PAL

PO302001
CTPD540_CMF
CTPD550_CMF
CTPD810_CMF

EB302001
CTPD540_CMF
CTPD550_CMF
CTPD810_CMF


Batch file code given to me by mpfister (i am very grateful for the code & help that you have provided. Very grateful)

@Echo off
Set OutFile="Result.txt"
Set LogFile="Ftp.log"
If not exist %LogFile% Goto :EOF
If exist %OutFile% del %OutFile%
for /f "usebackq delims=" %%a in (`findstr /v /C:">" %LogFile%`) Do Set Line=%%a& Call :Process
Goto :EOF
:Process
SET Check=%Line:~0,4%
If not Defined Check Goto :EOF
If /I "%Check%" == "cd P" Goto :Directory
If /I "%Check%" == "150 " Goto :File
Goto :EOF
:Directory
SET Directory=%Line:~3,99%
Echo %Directory%>> %OutFile%
Goto :EOF
:File
SET File=%Line:~44,99%
For /f "tokens=1,2 delims=_-." %%b in ("%File%") do Set File1=%%b& Set File2=%%c
SET Check=%File2:~0,1%
Echo %Check%
If "%Check%" == "2" (
     Echo %File1%>>%OutFile%
) Else (
     Echo %File1%_%File2%>>%OutFile%
)
Goto :EOF

I urgently need help with this batch file. I don't have the expertise in writing these scripts quickly. Would apprecaite any help.

Thank You
0
ben1211
Asked:
ben1211
  • 3
  • 2
1 Solution
 
LittleRed1Commented:
Hi Ben1211

I can help you with this, but I'll need a couple of things:

 - Can you post or send me a more extensive version of the ftp log file which includes more directory names
 - Can you give me a better idea of exactly what you would want out of the ftp log file report. You have posted several requests that seem to have cumulative requirements. Basically, I need to know what you want from the resulting report, i.e, do you want basic info like diretory names and numbers of files, or do you want detailed info, or do you want both summary info and detailed info?
 - What format would you prefer the report was in (text, formatted text, html,......)?
0
 
ben1211Author Commented:
LittleRed1, I truly and urgently need help with this Batch File. If I could give you 10000 points for your help, I would. It is that urgent. mpfisted gave some batch coding previously. You could look at it. LittleRed1, when you write a Batch file, please provide comments so that I can understand what it is doing. I want to learn, and not just get coding and use it.


LittleRed1 as request, an extensive version of the FTP Log is  right below:

Basically the batch file should read the FTP Log file and list down the directories and all the reports that were uploaded to that directory.

1. The directory names are like: PO301001, PO302001, PO303001, EB201001, EB301001. (If in the future more diretories are added, I need to know where to make this change in the Batch Script). The script above provided by mpfister check only for the first character, which is "P". I need the flexibility for it to check more than 1 character, for example the first 3 or  characters.

2. The output result should be saved to a .txt file. The output in the .txt file should look somewhat like this :
(the entire filename of the report uploaded should be taken down and listed in the text file)

3.LittleRed1, I actually need two batch files. One batch file that simply does all that is stated here. And another seperate batch file that readS the same FTP listed below but it only looks for errors. Meaning it will list down the directory name and if there are any errors such as "Not Connected" or "Give_Up_Report Not Found" or "CTPD540_PAL-_20050516.pdf Not Found" or "Remote Host Connection Lost" in a seperate text file.


OUTPUT FOR QUESTION 3 SHOULD LOOK LIKE THE BELOW:
PO301001 (should pick up all the directories in the FTP Log file)
Not Connected
Give_Up_Report.pdf Not Found
Remote Host Connection Lost

EO301001 (should pick up all the directories in the FTP Log file)
Not Connected
Give_Up_Report.pdf Not Found
Remote Host Connection Lost

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


OUTPUT FOR QUESTION 1 & 2 SHOULD LOOK LIKE THE BELOW:
PO301001
CTPD540_PAL-_20050516.pdf
CTPD550_PAL-_20050516.pdf
CTPD810_PAL-_20050516.pdf

PO302001
CTPD540_CMF-_20050516.pdf
CTPD550_CMF-_20050516.pdf
CTPD810_CMF-_20050516.pdf

EB302001
CTPD540_20050516.pdf
CTPD550_20050516.rep
CTPD810_20050516.rep
Cross_List_Report.pdf
Give_Up_Report.pdf

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

EXTENSIVE VERSION OF FTP LOG BELOW:

Start of BO Reports File Transfer at 16:32:24 Wed 20050518
----------------------------------------------------------
ftp> Connected to 172.16.211.222.

open 172.16.211.222 22
220 Microsoft FTP Service
ftp> user reports reports
331 Password required for reports
230 User reports logged in.
ftp> ftp>
Interactive mode Off .

ftp> prompt
ftp>
bin
200 Type set to I.
ftp> Local directory now C:\MDB_BATCH_BO_REPORTS\Result_Report.

ftp> lcd C:\MDB_BATCH_BO_REPORTS\Result_Report
cd PO300001
250 CWD command successful.
ftp> cd TUE
250 CWD command successful.
ftp> mdelete *.*
200 Type set to I.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
ftp> mput CTPD*_AMF*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.02Seconds 979.88Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.02Seconds 989.69Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.03Seconds 498.16Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.03Seconds 489.48Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 15456 bytes sent in 0.01Seconds 1030.40Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 96495 bytes sent in 0.13Seconds 771.96Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_AMF-_20050517.pdf.
226 Transfer complete.
ftp: 34641 bytes sent in 0.00Seconds 34641000.00Kbytes/sec.

ftp> mput CTPD*_LAN*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 498.29Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 15679 bytes sent in 0.01Seconds 1045.27Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.00Seconds 15457000.00Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 96329 bytes sent in 0.11Seconds 883.75Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LAN-_20050517.pdf.
226 Transfer complete.
ftp: 15142 bytes sent in 0.02Seconds 946.38Kbytes/sec.

ftp> mput CTPD*_LBQ*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 15679 bytes sent in 0.03Seconds 505.77Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.03Seconds 510.81Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 96330 bytes sent in 0.11Seconds 883.76Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LBQ-_20050517.pdf.
226 Transfer complete.
ftp: 15142 bytes sent in 0.03Seconds 488.45Kbytes/sec.

ftp> mput CTPD*_LBZ*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 15679 bytes sent in 0.01Seconds 1045.27Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 96354 bytes sent in 0.13Seconds 770.83Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LBZ-_20050517.pdf.
226 Transfer complete.
ftp: 16026 bytes sent in 0.02Seconds 1001.63Kbytes/sec.

ftp> mput CTPD*_LCA*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 498.29Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.03Seconds 505.74Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 15112 bytes sent in 0.03Seconds 487.48Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LCA-_20050517.pdf.
226 Transfer complete.
ftp: 14879 bytes sent in 0.02Seconds 929.94Kbytes/sec.

ftp> mput CTPD*_LCH*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 498.29Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.03Seconds 482.59Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 96360 bytes sent in 0.11Seconds 884.04Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LCH-_20050517.pdf.
226 Transfer complete.
ftp: 15936 bytes sent in 0.02Seconds 996.00Kbytes/sec.

ftp> mput CTPD*_LCR*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.03Seconds 505.74Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 15834 bytes sent in 0.01Seconds 1055.60Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.03Seconds 482.59Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.00Seconds 15174000.00Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 15456 bytes sent in 0.03Seconds 498.58Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 96377 bytes sent in 0.13Seconds 771.02Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LCR-_20050517.pdf.
226 Transfer complete.
ftp: 24893 bytes sent in 0.02Seconds 1555.81Kbytes/sec.

ftp> mput CTPD*_LDD*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 15834 bytes sent in 0.01Seconds 1055.60Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.00Seconds 15174000.00Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 15456 bytes sent in 0.01Seconds 1030.40Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 15112 bytes sent in 0.01Seconds 1007.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LDD-_20050517.pdf.
226 Transfer complete.
ftp: 14879 bytes sent in 0.02Seconds 929.94Kbytes/sec.

ftp> mput CTPD*_LDI*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 482.72Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.05Seconds 328.57Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.00Seconds 15174000.00Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 15456 bytes sent in 0.01Seconds 1030.40Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 15112 bytes sent in 0.03Seconds 487.48Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LDI-_20050517.pdf.
226 Transfer complete.
ftp: 14879 bytes sent in 0.02Seconds 929.94Kbytes/sec.

ftp> mput CTPD*_LDJ*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 498.29Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 15679 bytes sent in 0.03Seconds 505.77Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.00Seconds 15835000.00Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.03Seconds 489.48Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 96359 bytes sent in 0.11Seconds 875.99Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LDJ-_20050517.pdf.
226 Transfer complete.
ftp: 15276 bytes sent in 0.02Seconds 954.75Kbytes/sec.

ftp> mput CTPD*_LDK*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 15679 bytes sent in 0.01Seconds 1045.27Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.03Seconds 498.61Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 15112 bytes sent in 0.03Seconds 487.48Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LDK-_20050517.pdf.
226 Transfer complete.
ftp: 14879 bytes sent in 0.02Seconds 929.94Kbytes/sec.

ftp> mput CTPD*_LDU*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.05Seconds 328.66Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.03Seconds 510.81Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 15456 bytes sent in 0.01Seconds 1030.40Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 96364 bytes sent in 0.13Seconds 770.91Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LDU-_20050517.pdf.
226 Transfer complete.
ftp: 15280 bytes sent in 0.02Seconds 955.00Kbytes/sec.

ftp> mput CTPD*_LDV*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.03Seconds 505.74Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 96349 bytes sent in 0.13Seconds 770.79Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LDV-_20050517.pdf.
226 Transfer complete.
ftp: 15266 bytes sent in 0.02Seconds 954.13Kbytes/sec.

ftp> mput CTPD*_LDZ*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.03Seconds 482.59Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.03Seconds 489.48Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 15112 bytes sent in 0.01Seconds 1007.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LDZ-_20050517.pdf.
226 Transfer complete.
ftp: 14879 bytes sent in 0.02Seconds 929.94Kbytes/sec.

ftp> mput CTPD*_LEA*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 498.29Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.00Seconds 15678000.00Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.03Seconds 482.59Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 96379 bytes sent in 0.16Seconds 617.81Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LEA-_20050517.pdf.
226 Transfer complete.
ftp: 24880 bytes sent in 0.01Seconds 1658.67Kbytes/sec.

ftp> mput CTPD*_LEB*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.01Seconds 1029.80Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.03Seconds 482.59Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.00Seconds 15457000.00Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 96435 bytes sent in 0.13Seconds 771.48Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LEB-_20050517.pdf.
226 Transfer complete.
ftp: 25035 bytes sent in 0.02Seconds 1564.69Kbytes/sec.

ftp> mput CTPD*_LEF*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 15443 bytes sent in 0.02Seconds 965.19Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.03Seconds 483.03Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 15112 bytes sent in 0.01Seconds 1007.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LEF-_20050517.pdf.
226 Transfer complete.
ftp: 14879 bytes sent in 0.00Seconds 14879000.00Kbytes/sec.

ftp> mput CTPD*_LES*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LES-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.02Seconds 965.44Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LES-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LES-_20050517.pdf.
226 Transfer complete.
ftp: 15834 bytes sent in 0.01Seconds 1055.60Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LES-_20050517.pdf.
226 Transfer complete.
ftp: 15441 bytes sent in 0.03Seconds 482.53Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LES-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LES-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LES-_20050517.pdf.
226 Transfer complete.
ftp: 15112 bytes sent in 0.01Seconds 1007.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LES-_20050517.pdf.
226 Transfer complete.
ftp: 14879 bytes sent in 0.02Seconds 929.94Kbytes/sec.

ftp> mput CTPD*_LEV*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 482.72Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.01Seconds 1045.20Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.01Seconds 1055.67Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 15441 bytes sent in 0.02Seconds 965.06Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.01Seconds 1030.47Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 96439 bytes sent in 0.11Seconds 884.76Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_LEV-_20050517.pdf.
226 Transfer complete.
ftp: 25036 bytes sent in 0.02Seconds 1564.75Kbytes/sec.

ftp> mput CTPD930*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD930_20050517.pdf.
226 Transfer complete.
ftp: 99393 bytes sent in 0.11Seconds 911.86Kbytes/sec.

ftp> mput CTPD960*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD960_200505.pdf.
226 Transfer complete.
ftp: 104176 bytes sent in 0.11Seconds 955.74Kbytes/sec.

ftp> mput CTPD961*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD961_200505.pdf.
226 Transfer complete.
ftp: 18456 bytes sent in 0.05Seconds 392.68Kbytes/sec.

ftp> mput CTPD962*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD962_20050517.pdf.
226 Transfer complete.
ftp: 16473 bytes sent in 0.03Seconds 514.78Kbytes/sec.

ftp> mput CTPD963*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD963_20050517.pdf.
226 Transfer complete.
ftp: 15891 bytes sent in 0.00Seconds 15891000.00Kbytes/sec.

ftp> cd ..
250 CWD command successful.
ftp> cd ..
250 CWD command successful.
ftp> ftp>
ftp>
bin
200 Type set to I.
ftp> Local directory now C:\MDB_BATCH_BO_REPORTS\Result_Report.

ftp> lcd C:\MDB_BATCH_BO_REPORTS\Result_Report
cd PO301001
250 CWD command successful.
ftp> cd TUE
250 CWD command successful.
ftp> mdelete *.*
200 Type set to I.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
ftp> mput CTPD*_PAL*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 15447 bytes sent in 0.03Seconds 498.29Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 15678 bytes sent in 0.02Seconds 979.88Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 15835 bytes sent in 0.03Seconds 510.81Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 15441 bytes sent in 0.01Seconds 1029.40Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 15174 bytes sent in 0.02Seconds 948.38Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 15457 bytes sent in 0.02Seconds 966.06Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 96428 bytes sent in 0.11Seconds 884.66Kbytes/sec.

200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_PAL-_20050517.pdf.
226 Transfer complete.
ftp: 25036 bytes sent in 0.01Seconds 1669.07Kbytes/sec.

ftp> mput CTPD930*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD930_20050517.pdf.
226 Transfer complete.
ftp: 99393 bytes sent in 0.09Seconds 1057.37Kbytes/sec.

ftp> mput CTPD960*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD960_200505.pdf.
226 Transfer complete.
ftp: 104176 bytes sent in 0.09Seconds 1108.26Kbytes/sec.

ftp> mput CTPD961*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD961_200505.pdf.
226 Transfer complete.
ftp: 18456 bytes sent in 0.00Seconds 18456000.00Kbytes/sec.

ftp> mput CTPD962*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD962_20050517.pdf.
226 Transfer complete.
ftp: 16473 bytes sent in 0.00Seconds 16473000.00Kbytes/sec.

ftp> mput CTPD963*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD963_20050517.pdf.
226 Transfer complete.
ftp: 15891 bytes sent in 0.00Seconds 15891000.00Kbytes/sec.

ftp> cd ..
250 CWD command successful.
ftp> cd ..
250 CWD command successful.
ftp> ftp>
ftp>
ftp>
bin

200 Type set to I.
ftp> Local directory now C:\MDB_BATCH_BO_REPORTS\Result_Report.

ftp> lcd C:\MDB_BATCH_BO_REPORTS\Result_Report
cd EB002001
250 CWD command successful.
ftp> cd TUE
250 CWD command successful.
ftp> mdelete *.*
200 Type set to I.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
250 DELE command successful.
ftp> mput CTPD540_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_20050517.pdf.
226 Transfer complete.
ftp: 692326 bytes sent in 0.66Seconds 1055.38Kbytes/sec.

ftp> mput CTPD550_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_20050517.pdf.
226 Transfer complete.
ftp: 59123 bytes sent in 0.02Seconds 3695.19Kbytes/sec.

ftp> mput CTPD810_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_20050517.pdf.
226 Transfer complete.
ftp: 504219 bytes sent in 0.45Seconds 1113.07Kbytes/sec.

ftp> mput CTPD974_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_20050517.pdf.
226 Transfer complete.
ftp: 422840 bytes sent in 0.42Seconds 1001.99Kbytes/sec.

ftp> mput CTPD970_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_20050517.pdf.
226 Transfer complete.
ftp: 63717 bytes sent in 0.02Seconds 3982.31Kbytes/sec.

ftp> mput CTPD971_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_20050517.pdf.
226 Transfer complete.
ftp: 66760 bytes sent in 0.11Seconds 612.48Kbytes/sec.

ftp> mput CTPD975_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_20050517.pdf.
226 Transfer complete.
ftp: 4662329 bytes sent in 4.31Seconds 1080.99Kbytes/sec.

ftp> mput CTPD976_2*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_20050517.pdf.
226 Transfer complete.
ftp: 800634 bytes sent in 0.77Seconds 1046.58Kbytes/sec.

ftp> mput CTPD950*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD950_20050517.pdf.
226 Transfer complete.
ftp: 687479 bytes sent in 0.64Seconds 1072.51Kbytes/sec.

ftp> mput CTPD951*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD951_20050517.pdf.
226 Transfer complete.
ftp: 4084539 bytes sent in 3.80Seconds 1075.73Kbytes/sec.

ftp> mput CTPD910*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD910_20050517.pdf.
226 Transfer complete.
ftp: 208364 bytes sent in 0.25Seconds 833.46Kbytes/sec.

ftp> mput CTPD930*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD930_20050517.pdf.
226 Transfer complete.
ftp: 99393 bytes sent in 0.09Seconds 1057.37Kbytes/sec.

ftp> mput CTPD960*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD960_200505.pdf.
226 Transfer complete.
ftp: 104176 bytes sent in 0.09Seconds 1120.17Kbytes/sec.

ftp> mput CTPD961*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD961_200505.pdf.
226 Transfer complete.
ftp: 18456 bytes sent in 0.00Seconds 18456000.00Kbytes/sec.

ftp> mput CTPD962*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD962_20050517.pdf.
226 Transfer complete.
ftp: 16473 bytes sent in 0.00Seconds 16473000.00Kbytes/sec.

ftp> mput CTPD963*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD963_20050517.pdf.
226 Transfer complete.
ftp: 15891 bytes sent in 0.00Seconds 15891000.00Kbytes/sec.

ftp> mput CTPD010*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD010_20050517.pdf.
226 Transfer complete.
ftp: 97521 bytes sent in 0.09Seconds 1037.46Kbytes/sec.

ftp> ftp> mput Allocation_DiscrePancies_Report*.pdf
Allocation_DiscrePancies_Report*.pdf:File not found
ftp> mput Client_Similarity_Report*.pdf
Client_Similarity_Report*.pdf:File not found
ftp> mput Give_Up_Report*.pdf
Give_Up_Report*.pdf:File not found
mput Cross_List_Report*.pdf
200 PORT command successful.
150 Opening BINARY mode data connection for Cross_List_Report_20050517.pdf.
226 Transfer complete.
ftp: 29480 bytes sent in 0.02Seconds 1842.50Kbytes/sec.

ftp> ftp>
mput CTPD540_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD540_20050517.rep.
226 Transfer complete.
ftp: 228864 bytes sent in 0.24Seconds 973.89Kbytes/sec.

ftp> mput CTPD550_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD550_20050517.rep.
226 Transfer complete.
ftp: 120832 bytes sent in 0.11Seconds 1108.55Kbytes/sec.

ftp> mput CTPD810_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD810_20050517.rep.
226 Transfer complete.
ftp: 179712 bytes sent in 0.17Seconds 1050.95Kbytes/sec.

ftp> mput CTPD974_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD974_20050517.rep.
226 Transfer complete.
ftp: 164352 bytes sent in 0.19Seconds 878.89Kbytes/sec.

ftp> mput CTPD970_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD970_20050517.rep.
226 Transfer complete.
ftp: 280576 bytes sent in 0.31Seconds 896.41Kbytes/sec.

ftp> mput CTPD971_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD971_20050517.rep.
226 Transfer complete.
ftp: 227840 bytes sent in 0.25Seconds 911.36Kbytes/sec.

ftp> mput CTPD975_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD975_20050517.rep.
226 Transfer complete.
ftp: 244224 bytes sent in 0.24Seconds 1039.25Kbytes/sec.

ftp> mput CTPD976_2*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD976_20050517.rep.
226 Transfer complete.
ftp: 195072 bytes sent in 0.17Seconds 1134.14Kbytes/sec.

ftp> mput CTPD950*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD950_20050517.rep.
226 Transfer complete.
ftp: 202240 bytes sent in 0.22Seconds 923.47Kbytes/sec.

ftp> mput CTPD951*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD951_20050517.rep.
226 Transfer complete.
ftp: 563200 bytes sent in 0.53Seconds 1060.64Kbytes/sec.

ftp> mput CTPD910*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD910_20050517.rep.
226 Transfer complete.
ftp: 112128 bytes sent in 0.11Seconds 1019.35Kbytes/sec.

ftp> mput CTPD930*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD930_20050517.rep.
226 Transfer complete.
ftp: 147456 bytes sent in 0.17Seconds 857.30Kbytes/sec.

ftp> mput CTPD960*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD960_200505.rep.
226 Transfer complete.
ftp: 146432 bytes sent in 0.16Seconds 938.67Kbytes/sec.

ftp> mput CTPD961*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD961_200505.rep.
226 Transfer complete.
ftp: 117248 bytes sent in 0.11Seconds 1075.67Kbytes/sec.

ftp> mput CTPD962*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD962_20050517.rep.
226 Transfer complete.
ftp: 116736 bytes sent in 0.11Seconds 1061.24Kbytes/sec.

ftp> mput CTPD963*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD963_20050517.rep.
226 Transfer complete.
ftp: 131072 bytes sent in 0.48Seconds 270.25Kbytes/sec.

ftp> mput CTPD010*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for CTPD010_20050517.rep.
226 Transfer complete.
ftp: 141312 bytes sent in 0.17Seconds 821.58Kbytes/sec.

ftp> ftp> mput Allocation_DiscrePancies_Report*.rep
Allocation_DiscrePancies_Report*.rep:File not found
ftp> mput Client_Similarity_Report*.rep
Client_Similarity_Report*.rep:File not found
ftp> mput Give_Up_Report*.rep
Give_Up_Report*.rep:File not found
mput Cross_List_Report*.rep
200 PORT command successful.
150 Opening BINARY mode data connection for Cross_List_Report_20050517.rep.
226 Transfer complete.
ftp: 77824 bytes sent in 0.11Seconds 713.98Kbytes/sec.

ftp> ftp>
cd ..
250 CWD command successful.
ftp> cd ..
250 CWD command successful.
ftp> ftp>
ftp>
quit
221  
 
End of BO Reports File Transfer at 16:35:13 Wed 20050518
----------------------------------------------------------
 
_______________________________________________________________________
0
 
LittleRed1Commented:
OK,

Try the code below, i think is does what you want. I noticed that you wanted the number of files in each directory in one of your previous requests, so I've put that at the end of each directory list.

I have place a TAB in front of the filenames and errors to make is easier to read.

All you have to do is set the four variables at the beginning of the script. The last one is a comma separated list of error strings to look for. I had to o this because there does not appear to be any other way to associate errors in the log file. You may have to adjust or expand these strings to capture all the errors you encounter.

I will post again later with comments on the script as my time is short right now.

-------------------------------------------Copy between the lines------------------------------------
@echo off
setlocal ENABLEDELAYEDEXPANSION

set outfile=report.txt
set errorlog=errorlog.txt
set logfile=ftp.log
set errorlist="Not Connected","Not Found","Remote Host Connection Lost"

set count=

if not exist "!logfile!" echo ERROR - Log file does not exist>report.txt&goto end
>"!outfile!" echo FTP log report generated at %time:~0,-6% on %date%

for /f "tokens=1* delims= " %%a in (!logfile!) do (
      if /i "%%a" == "cd" (
            if not "%%b" == ".." (
            echo Listing file in %%b
                  (
                        if not "!count!" == "" echo Total !count! files
                        echo.
                        echo %%b
                        set count=0
                  )>>"!outfile!"
            )
      ) else if "%%a" == "150" (
            for /f "tokens=7,8 delims=. " %%c in ("%%b") do (
                  >>"!outfile!" echo       %%c.%%d
                  set /a count=!count!+1
            )
      )
)
(
      echo Total !count! files
      echo.
      echo Report complete
)>>!outfile!
echo Report complete

echo Building report for errors
set count=
>"!errorlog!" echo FTP log error report generated at %time:~0,-6% on %date%

for /f "tokens=1,2* delims=:> " %%a in (!logfile!) do (
      if /i "%%a" == "cd" (
            if not "%%b" == ".." (
                  (
                        if not "!count!" == "" echo Total !count! errors
                        echo.
                        echo %%b
                        set count=0
                  )>>"!errorlog!"
            )
      ) else if /i not "%%a" == "ftp" if /i not "%%a" == "200" if /i not "%%a" == "150" if /i not "%%a" == "226" if /i not "%%a" == "250" (
            for %%d in (!errorlist!) do (
                  echo %%a %%b %%c|findstr /i /C:%%d>nul&&(>>!errorlog! echo       %%a %%b %%c&set /a count=!count!+1)
            )
      )
)
(
      echo Total !count! errors
      echo.
      echo Error report complete
)>>!errorlog!
echo Error report complete
:end
---------------------------------------------------------------------------------------------------------
0
 
ben1211Author Commented:
LittleRed1,

I have tested the code that you provided me. It works GREAT! I must say without a doubt that you are FANTASTIC. I thank you for helping me out.

LittleRed1, you mentioned that you will add comments to the code later. Could you please add as much comments and explanations as possible. I have looked at the code and find difficulty in understanding it. I need your help with some explanation of the code. I don't want to be just using the code, but instead I want to understand it and be able to write it on my own. Your help is much appreciated.

Thank You.

Ben
0
 
LittleRed1Commented:
OK, here goes (comments follow the ::)


:: Prevent from echoing to the console
@echo off
:: setlocal tells the script to keep variables local to the script, i.e. variables will not be set in the environment.
:: ENABLEDELAYEDEXPANSION - this enables local expansion of variables, necessary for doing things like incrementing. I always set this.
setlocal ENABLEDELAYEDEXPANSION

:: Here we set the variables that might need to be adjusted by the user. This makes it easier to customise the script. In larger, more complex scripts I store all these in a separate file.

:: outfile is the name of the report file. You could use a full drive:path for this file as all references are between quotes.
set outfile=report.txt
:: errorlog is the name of the errors file. This file will contain all the lines in the ftp log that are errors.
set errorlog=errorlog.txt
:: logfile is the name of the ftp log.
set logfile=ftp.log
:: errorlist is basically a comma separated list of strings to look for that indicate errors. This is needed because the ftp log file does not log codes for these errors, so we have to use string comparison. The current strings will capture all the errors that I know about, but should be expanded if you encounter any others. The comparison is not case sensitive as I use 'if /i'.
set errorlist="Not Connected","Not Found","Remote Host Connection Lost"

:: clear the count variable. count will be used for counting the number of files in each directory. You could also expand on this by using a separate variable to get a total on all files.
set count=

::This line checks for the existence of the log file. It writes an error message to the outfile and exits if not found.
if not exist "!logfile!" echo ERROR - Log file does not exist>"!outfile!"&goto end

:: This line initialises the outfile with a line containing the date and time. I use %time:~0,-6% to strip the seconds and hundredths off the time (0,-6 means display all characters from the first to the character before the sixth last). Note the single '>' redirection which overwrites the file if it exists.
>"!outfile!" echo FTP log report generated at %time:~0,-6% on %date%

:: This 'for' loop simply reads each line contained in the ftp log file and does the tasks between the brackets on each. The tokens 1* breaks each line up into two parameters (space is used as the delimeter), one for the first field (%%a) and one for the rest of the line (%%b). I do this because the log entries are quite predictable, many of them actually containing a log code. In this case, we're interested in two - cd and 150.
for /f "tokens=1* delims= " %%a in (!logfile!) do (
:: This 'if' determines whether the current line is a 'cd' (change directory) command. If it is, execute the commands between the brackets.
     if /i "%%a" == "cd" (
:: Since the 'cd command appears in the log file for going back up the directory structure (cd ..), we need to ignore these lines.
          if not "%%b" == ".." (
:: Simple echo to console to provide feedback on the progress of the script.
          echo Listing files in %%b
:: The echoes between these brackets are echoed to the outfile. Placing an 'if' command inside the brackets provides us with a little flexibilty over what is echoed.
               (
:: This 'if' command will only echo if the 'count' variable is set. This means that this line is echoed at the beginning of each directory except the first one. The 'count' variable will contain the number of files copied in the previous directory.
                    if not "!count!" == "" echo Total !count! files
                    echo.
                    echo %%b
:: This 'set' command resets the count variable to zero, since it's a new directory.
                    set count=0
               )>>"!outfile!"
          )
:: This 'else if' determines whether the current line is a successful file copy (ftp return code 150). If it is, execute the commands between the brackets.          
     ) else if "%%a" == "150" (
:: This 'for' command extracts the 7th and 8th fields (the file name and extension) from the 150 line. You would need to adjust this if you expect to have files that contain more than one '.'
          for /f "tokens=7,8 delims=. " %%c in ("%%b") do (
:: This simply echoes the file name and extension to the outfile.
               >>"!outfile!" echo      %%c.%%d
:: This 'set' increments the count variable. /a is used for doing numerical calculations in 'set'. It's very limited but useful for basic integers. I have used 'count=!count!+1' for clarity, but normally I use 'count+=1', which does the same thing.
               set /a count=!count!+1
          )
     )
)
(
:: This echo writes the count of the last directory to the outfile
     echo Total !count! files
     echo.
     echo Report complete
)>>!outfile!
:: Simple echo to console to provide feedback on the progress of the script.
echo Report complete

:: Now we do a similar thing again, but look for the errors instead. I could have done this in the first 'for' command, but it might get a little complicated, so I elected to keep it separate.

:: Simple echo to console to provide feedback on the progress of the script.
echo Building report for errors
:: Clear the count variable again
set count=
:: Initialise the errorlog file with the date and time.
>"!errorlog!" echo FTP log error report generated at %time:~0,-6% on %date%

:: The same 'for' command as above, but this time get the first and second field plus the rest of the line. I don't have any real reason for the second field, it just makes me feel better.
for /f "tokens=1,2* delims=:> " %%a in (!logfile!) do (
:: Same as above for finding the directories.
     if /i "%%a" == "cd" (
          if not "%%b" == ".." (
               (
                    if not "!count!" == "" echo Total !count! errors
                    echo.
                    echo %%b
                    set count=0
               )>>"!errorlog!"
          )
:: Now, this 'else if' command is used to ignore all the lines that start with a known good field. These would be all the ftp codes that are known to not be errors, including lines that begin with 'ftp'. You should also note that I added the '>' and ':' delimiters in the 'for' command to get rid of these characters after the 'ftp' line in the log file. If in the future you find an error line that begins with 'ftp', you'll need to remove this from the list of 'if's in this line. You could also add other known ones. The reason I do this is simply to reduce the processing requirement on the script. If it has to do string comparisons on every line it will take a while (and a lot of CPU).
     ) else if /i not "%%a" == "ftp" if /i not "%%a" == "200" if /i not "%%a" == "150" if /i not "%%a" == "226" if /i not "%%a" == "250" (
:: This 'for' command basically takes each of the strings specified in the errorlist variable and passes it to the lines between the between the brackets
          for %%d in (!errorlist!) do (
:: This command echoes the contents of the line (%%a %%b %%c) which is piped (|) to the findstr command to look for the string passed to it by the 'for' command (from the errorlist variable). If 'findstr' returns with success the line is echoed to the errorlog file and count is incremented. The '&&' basically runs the following command on success of the previous one. You would use '||' for the opposite. The >nul at the end of the findstr command redirects output to nul, since we're not interested in the output, just the return code. I enclose the echo and set commands in brackets so that they are both executed when the success condition is met. Not enclosing them in brackets would produce very different behaviour.
               echo %%a %%b %%c|findstr /i /C:%%d>nul&&(>>"!errorlog!" echo      %%a %%b %%c&set /a count=!count!+1)
          )
     )
)
(
:: This echo writes the count of the last directory to the outfile
     echo Total !count! errors
     echo.
     echo Error report complete
)>>"!errorlog!"
:: Simple echo to console to provide feedback on the progress of the script.
echo Error report complete
:: Placeholder for the end of the script. Used to exit prematurely when an error is found. Cleanup commands could be executed here if needed.
:end
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now