Guest User

Untitled

a guest
Oct 15th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  Dim objShell, objFso, objFsoRead, strRead, aryFields, strConnection
  2.  Dim strID, strAdd, strCity, strState, strZip, strPhone, strEmail
  3.  Dim rst, cnn
  4.  
  5.  Set objShell = CreateObject("Wscript.Shell")
  6.  Set objFso = CreateObject("Scripting.FileSystemObject")
  7.  Set cnn = CreateObject("ADODB.Connection")
  8.  Set rst = CreateObject("ADODB.Recordset")
  9.  Set objFsoRead = objFso.OpenTextFile("C:\email\grades.txt",1)
  10.  Set objFsoWrite = objFso.OpenTextFile("c:\email\failing students.txt",8,true)
  11.  
  12.  '****************************************************************
  13. 'Open flat text file and read the address info.
  14. '****************************************************************
  15.  
  16.   Do While objFsoRead.AtEndOfStream <> True
  17.    strRead = objFsoRead.ReadLIne
  18.  
  19.    strFN = Mid(strRead,36,10)
  20.    strMN = Mid(strRead,46,1)
  21.    strLN = Mid(strRead,24,12)
  22.    strCG = Mid(strRead,60,1)
  23.    strOut = trim(strFN) & ", " & trim(strMN) & trim(strLN) & trim(strCG)
  24.    
  25.    if strCG = F then objFsoWrite.writeline(strOut)
  26.   Loop
  27.  
  28. objFsoRead.close
  29. objFsoWrite.close
Add Comment
Please, Sign In to add comment