Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Each of this files have a content with lines separated with "," like an array
- 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
- e.g.
- files[0] = all complete array of the first file, i mean all content of the file.
- thanks for your help
- class Example
- def self.one
- all_files = Dir.glob('C:/Users/*') - Dir.glob('C:/Users/My Orders-*.txt')
- quantity_files = all_files.size
- counter = 0
- files = Dir.glob('C:/Users/*') - Dir.glob('C:/Users/My Orders-*.txt')
- myarray = []
- while counter < quantity_files
- File.open(files[counter]).each do |file|
- myarray << file
- end
- counter += 1
- end
- p myarray[0]
- end
- end
- Example.one
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement