title: I need to count how many .zip files in a folder and transfer to a variable. Then compare with successful 226 transfers in a txt log file
body: <p>I found this site using a search which was a great help.  I was able to modify part of a previous solution to do what I need but I still need some help.  I need to do this in a batch file and was hoping to get a solution or two.</p>
  
  <p>What I need to do is Transfer 1 to 10 zip files from my PC to multiple FTP Servers.  I then need to check to make sure they are transferred successfully.  On my PC I'm using regular MS FTP and the servers are using IndiFTPD.  I have everything done except for the checking part.  Some of the FTP Servers are Dial up and wireless and they get disconnected from time to time.  So if I'm transferring say 3 files and the first one fails but the other two are successful my script lists it as successful.  </p>
  
  <p>I have was able to get a count of how many zip files are in the transfer folder and put it into a variable.  The code for that is:</p>
  
  <pre><code>@echo off
  
  
  for /f %%A in ('dir *.zip ^| find "File(s)"') do set cnt=%%A
  echo Zip File count = %cnt%
  </code></pre>
  
  <p>What I'm having trouble with is getting the same information from the text log file of the FTP transfer and then comparing the two to make sure they are the same.  Here is an example of a log of an FTP transfer I would make:</p>
  
  <pre><code>ftp&gt; Connected to Host1.
  open Host1 21 
  220 Connected to IndiFTPD
  ftp&gt; Username user 
  user1
  331 Password required for Folder1.
  
  230 User user1 logged in.
  ftp&gt; Hash mark printing On  ftp: (2048 bytes/hash mark) .
  ftp&gt; hash 
  binary 
  200 Type is set to I.
  ftp&gt; mput *.zip 
  200 PORT command successful.
  150 Opening BINARY mode data connection for 2012_07_01_03_40_1_3_TESTFTPs.zip.
  ###############################################################################################
  226 [Bytes: 195046][Time: 1.13 s][Speed: 168.26 K/s]
  ftp: 195046 bytes sent in Seconds Kbytes/sec.
  0.78251.67200 PORT command successful.
  150 Opening BINARY mode data connection for 2012_07_01_03_40_2_3_TESTFTPs.zip.
  ###############################################################################################
  226 [Bytes: 195046][Time: 1.13 s][Speed: 168.41 K/s]
  ftp: 195046 bytes sent in Seconds Kbytes/sec.
  0.77253.31200 PORT command successful.
  150 Opening BINARY mode data connection for 2012_07_01_03_40_3_3_TESTFTPs.zip.
  ###############################################################################################
  226 [Bytes: 195046][Time: 1.14 s][Speed: 166.79 K/s]
  ftp: 195046 bytes sent in Seconds Kbytes/sec.
  ftp&gt; 0.78249.42bye 
  221 Exit.
  </code></pre>
  
  <p>I would like to be able to use the <code>%cnt%</code> variable from the first part of the script to get the count of zip files I have.  Then I would like to get able to count the number of "226 [Bytes" in the log file which is named terminal-ftp.txt.  Then once I have both values in variable form I need to compare them to ensure I have 3 FTP files and 3 Successful 226 transfers.  If they don't match then I would need to flag it up for a retry.</p>