2016-03-15

Yesterday I had to do some task across all files in a directory. The directory had subdirectories which in turn had subdirectories again. Although I know that there was a Dir module in ruby, I didn’t know that it would have the function necessary. But when I googled I found a method named glob in the Dir module. So I am just writing this post to show how it works.

This is particularly easy but I was wondering how much time I took.

Also there was another problem due to encoding. These files were encoded in windows-1252. I used my dear linux to fix it.

These are some easy ones. But it actually took me a whole day to find all this. (Well not a whole day :))

Show more