search for: col_sep

Displaying 8 results from an estimated 8 matches for "col_sep".

Did you mean: col_s1
2011 Aug 03
2
Malformed CSV Error
...::MalformedCSVError: Unclosed quoted field on line 1892.>. I have following code :- -------------------------------------------------- @parsed_file = CSV.open("#{RAILS_ROOT}/private/sales_report_files/#{@file_folder}/#{@sub_file_folder}/#{@file_name.filename}",''r'',:col_sep =>?\t) @parsed_file.each_with_index do |row, index| # getting error on this line // some code end -------------------------------------------------- I have tried to escape row no.-1892 by using ''@parsed_file.shift'', but it didn''t work. Please suggest, so I can...
2011 Feb 18
1
why 'Template missing' error with form_tag?
...ds_controller.rb) def process_file post = Upload.import(params[:file]) flash[:ok] = "data imported" redirect_to :action => index end and here is my model (in models/upload.rb): def self.import(file) FasterCSV.foreach(file.path,:headers=>"first_row", :col_sep=>"\t") do |row| # here is where we will parse the data but just this stub for now: row.each{|row| puts "row: #{row.inspect}"} end end Can anyone please point out my dumb error here? Would sooooooooo appreciate the help (this forum rocks....have learned...
2007 Nov 13
0
FasterCSV: ignoring returns within a db field
...occur within(!) a database text field and to read until "line feed" = end or row is reached? I tried to use option ":row_sep" but it did not work, it still uses the returns within the text field as end of row, too: FasterCSV.foreach("test", :headers => :first_row, :col_sep => ",", :row_sep => "\n") do |row| (\n should be line feed in ruby, right?) I also thought about replacing the return and line feed symbols by something else, but I don''t want to loose the return-information which I need for displaying the text of this field in...
2009 May 21
0
FasterCSV won't accept :headers option
When I pass :headers => true to FasterCSV.foreach it complains. Without it it works. Am I doing something wrong? FasterCSV.foreach(file, {:row_sep => :auto, :col_sep => "\t", :quote_char => "~", :return_headers => false, :headers => true}) do |row| -- Posted via http://www.ruby-forum.com/.
2012 Nov 07
0
redirect from a collection_action to another class
...te import file"* * * * raise "File" + filename + "doesn''t not exist" unless File.exist(filename)* * * * ri = RouteImporter.find(:name => self.class.name)* * * * if(ri.nil?)* * puts "Error, file doesn''t exists"* * end* * CSV.foreach(filename, {:col_sep => @seperator}) do |row|* * .* * .* * .* * .* * .* * end* * * I don''t know how can I do this, I''ve been trying few things like :action => :import_route, but it doesn''t work, or if maybe shou...
2008 May 25
2
How to create tab-delimited text files
Hello Friends I want to generate tab-delimited text file of my every users information in once. i have a button called EXPORT on my page when i clicked on this button than i want to generate tab-delimited text file for every users information. can anybody give any snippet of code or any idea for this Thanks -- Posted via http://www.ruby-forum.com/.
2011 May 19
3
Cookie Overflow at CSV import
...39; in the controller, but I am not sure. How can I avoid that error? I found something about using session_store instead of cookie_store, but I don''t know how to do that. I have the following in my controller: file = params[:file] CSV.new(file.tempfile, {:headers => false, :col_sep => ";"}).each do |row| @list << row[1] end end and this in my view: <%=form_tag ''/importcsv/csv_import'', :multipart => true do%> <%= file_field_tag "file" %><br/> <%= submit_tag("Import") %>...
2006 May 17
6
newbie wants to know..FasterCSV or just CSV?
I''m trying to grab a CSV file from a user and let them upload it directly to my database, but doing some minor checks on the data before saving. Which is the easier way to implement this? CSV or FasterCSV? I saw that perhaps there were some issues with FasterCSV and csv files created from Mac versions of Excel. Anyone have any experience with this and can recommend a newbie friendly