Running every file


I need to open every file in the folder matching the same pattern…


open every file matching “report” in folder


**and I need to return the filename to a variable ‘filename’

Try Dir.glob(pattern), as it returns an array with all of the files.

files = Dir.glob(“report”)

Hope that helps,

Michael G.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs