Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. 'Abrimos el archivo
  2. Dim objFS
  3. Dim objFile
  4. ReDim aSumaAmounts(0)
  5. ReDim aRestaAmount(0)
  6. sF1 = "C:Users" & Environment("UserName") & "Desktop20190414210000_OPEL_TRANSFER_DETAIL.TXT"
  7.  
  8. 'Abrimos el txt del Trasfer Details
  9. Set objFS = CreateObject("Scripting.FileSystemObject")
  10. Set objFile = objFS.OpenTextFile(sF1)
  11.  
  12. Do Until objFile.AtEndOfStream
  13.  
  14. intLine = objFile.Line
  15. sContent = objFile.ReadLine
  16. contentSplited = split(sContent, ";")
  17.  
  18. If contentSplited(3) = "FA" Then
  19.  
  20. If aSumaAmounts(0) = "" Then
  21. aSumaAmounts(0) = contentSplited(5)
  22. else
  23.  
  24. ReDim Preserve aSumaAmounts(UBound(aSumaAmounts) + 1)
  25. aSumaAmounts(UBound(aSumaAmounts)) = contentSplited(5)
  26.  
  27. End If
  28.  
  29. ElseIf contentSplited(3) = "NC" Then
  30.  
  31. If aRestaAmount(0) = "" Then
  32. aRestaAmount(0) = contentSplited(5)
  33. else
  34.  
  35. ReDim Preserve aRestaAmount(UBound(aRestaAmount) + 1)
  36. aRestaAmount(UBound(aRestaAmount)) = contentSplited(5)
  37.  
  38. End If
  39.  
  40. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement