How do I open a CSV file in irb


Hi Guys,

I’d like to better understand how file input and outputs work so I’d like to do some experimentation in the irb environment however I can’t figure out how to open the CSV file.

I know I should have “require “csv”” however when I type words =“wordlist.csv”) I get the following error: “Errno::ENOENT (No such file or directory @ rb_sysopen - wordlist.csv)”

does the file have to be saved in the same directory as irb?


If it isn’t in the same directory as you start irb in then you need to provide the path to it.