Answer the question
In order to leave comments, you need to log in
How to create a csv file, at the same time set headers for it, then add information there?
This is how it looks like:
How to create a csv file, at the same time set headers for it, which will not change in the future and will not be rewritten after going through the cycle and throwing information into the file?
#пробовал делать вот так, но Name и Price
#записываются еще раз после того как нужная инфа запишется и
#будет осуществлен дальшейний сбор инфы (Смотреть СКРИН)
CSV.open(output_file+".csv", "a") do |csv|
csv << ['Name ;Price'] #
#собирается различная информацию
#...
#
csv << ["#{Name}; #{Price}"] #происходит запись в файл
end
CSV.open(output_file+".csv", "a") do |csv|
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question