I have a csv file that I am inputting into an excel spreadsheet. One of
the fields is a hyperlink:
When FCSV comes across the file to process it and insert pass the data
to be inserted into the Excel file I get an error:
shift': Unclosed quoted field on line 1. (FasterCSV::MalformedCSVError) from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1512:inloop’
shift' from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1457:ineach’
foreach' from C:/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1175:inopen’
I’ve looked around and can’t seem to find anyone that has any
suggestions to get around this issue in FCSV. Anyone have any
Here is how I process the data from the csv file:
Open the csv data file being used to input the data to the Excel
Set the Column index to “A” this resets the colmn to “A” for each new
line in the data file.
file_in = FCSV.foreach(file_excel_input) do |line|
col_index = ‘a’
line_index += 1
#Index to the Active line where data will be Input in the Excel file
#Get the line with an index number for the file the index was for the
#cell number but used a col_index instead.
line.each_with_index do |element,i|
#Put the data into the Spread sheet here!!
Greatly Appreciate any help or suggestions, I am relatively new to Ruby
and programming. Thanks in Advance.