Im a real newbie and I have been reading a lot of threads regarding csv
and excel but still dont know how to solve my problem.
I have a csv file like this:
I would like to import this csv to an excel workbook. Later on work with
the cells but thats another issue. Right now I would like to start with
just import the csv.
So in my mind the solution should be something like this:
excel = WIN32OLE::new(‘excel.Application’)
wb = excel.Workbooks.Add()
ws = wb.Worksheets(1)
Now an excel workbook is created and I would like to import the CSV.
How? Is there a method or something that can be used?
I made this but dont know what to do for each iteration:
CSV.foreach(@filename,:headers => true, :quote_char => ‘"’, :col_sep
=> ‘,’, :row_sep =>:auto) do |row|
"This code should write one value to each cell in the row of the
worksheet "#puts row
Is this the best way of solving my problem?
Any suggestions are appreciated!