I have a directory structure, for example like this:
+SOURCE_CODE
+ MODULE_A
-myfile.txt
+ MODULE_B
-myfile.txt
+ MODULE_C
-myfile.txt
Now I would like to do "Dir.chdir" into each of these directories (MODULE_A, MODULE_B) and than open the "myfile.txt" where I than operate with the strings within these files. It should be something like this:
Dir.chdir "../SOURCE_CODE/MODULE_*/"
File.open("myfile.txt") do |f|
f.each_line do |line|
......
I know, it is not possible to use wildcards with "Dir.chdir". But is there an alternative way?