-1
我不知道它可能的,但這裏是我想要實現:紅寶石使用讀取CSV文件中獲取
Please enter file path to analyse your expenses :
user enters statment.csv
and programs reads data.
我的代碼:
require 'csv'
puts "Please enter file path to analize"
file = gets
data = CSV.read(file, headers: true)
>
>
>
該文件couldn這麼遠的消息」不被發現。 所有文件都在同一個文件夾中。 桌面/ expenses_calculator
Ë
'pp'是你的朋友調試Ruby程序時。嘗試使用'require'pp',然後使用'pp file'來查看'file'包含的內容。你會自己看到問題。 – Casper