Advertisement
Guest User

Untitled

a guest
May 24th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #Each of this files have a content with lines separated with "," like an array
  2. i am trying to find a way for make a big array and each element of my array is other array with the content of the each files
  3. e.g.
  4. files[0] = all complete array of the first file, i mean all content of the file.
  5. thanks for your help
  6.  
  7. class Example
  8. def self.one
  9. all_files = Dir.glob('C:/Users/*') - Dir.glob('C:/Users/My Orders-*.txt')
  10. quantity_files = all_files.size
  11. counter = 0
  12. files = Dir.glob('C:/Users/*') - Dir.glob('C:/Users/My Orders-*.txt')
  13.  
  14. myarray = []
  15. while counter < quantity_files
  16. File.open(files[counter]).each do |file|
  17. myarray << file
  18. end
  19. counter += 1
  20. end
  21. p myarray[0]
  22.  
  23. end
  24. end
  25. Example.one
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement