Advertisement
Guest User

Read File

a guest
Jul 30th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ' Весь файл
  3. Set file = fso.OpenTextFile("C:\test.txt", 1)
  4. content = file.ReadAll
  5.  
  6. ' Построчно
  7. Set dict = CreateObject("Scripting.Dictionary")
  8. Set file = fso.OpenTextFile ("c:\test.txt", 1)
  9. row = 0
  10. Do Until file.AtEndOfStream
  11.   line = file.Readline
  12.   dict.Add row, line
  13.   row = row + 1
  14. Loop
  15.  
  16. file.Close
  17.  
  18. 'Loop over it
  19. For Each line in dict.Items
  20.   WScript.Echo line
  21. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement