Displaying 20 results from an estimated 64 matches for "fastercsv".
2009 Jun 13
3
How Can I insert another column data into the CSV file when I use FasterCSV?
Hi, All,
Suppose I have a CSV file, there is data in it.
* Column 1 Column2 Column 3 Column 4
Row1 a b c
Row2 a2 b2 c2*
You know, the column 4 is no data
Now, I would like to insert data to Column 4, after save, the CSV file will
be:
* Column 1
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
path?
--
Posted via http://www.ruby-forum.com/.
2006 Aug 16
2
installing fastercsv into vendor directory
I am using fastercsv to process input files. I want to install it into
my app/vendor directory as a gem (I guess). I used ''rake
rails:freeze:gems'' to get rails into the vender dir. But I cannot find
any doc on how to do it for fastercsv or any third-party gem. Any help
appreciated.
--
Posted via...
2009 Feb 09
9
fastercsv, freezing into vendor/gems
I''m using fastercsv such that in my rake file I''m doing this.
require ''fastercsv''
It works fine on my Mac.
I need to freeze this gem into the app though so my rake tasks work on
the production machine.
-----------
I spent about two hours though this weekend trying to get this Gem
"...
2009 Jun 17
12
FasterCVS and Rails
Hello all,
I''m trying to import some csv data (that has latin characters) using
faster csv but I keep getting a MalformedCSVError:
"Unclosed quoted field on line 1."
"/ruby/lib/ruby/gems/1.8/gems/fastercsv-1.2.3/lib/faster_csv.rb:1592:in
`shift''"
I''ve tested the same code outside of the Rails application an it works
fine.
Can anyone help me?
Here is the code:
csv_options = {
:headers => false,
:return_headers => false,
:skip_blanks => false
}
csv_file_name =...
2007 Jul 25
3
FasterCSV load file to table
Hello Guys,
May be it is simply but any way.... fasterCSV 1.2.0
how to load data from file to table :( I have tried this:
file has just one line 1,2,3
data = FCSV.read("C:\\temp_file.csv")
table = FCSV.parse(data, :headers => true)
puts "data overview"
puts data
puts "table overview"
puts table
bu...
2010 Nov 30
0
Rails 3 & FasterCSV
I''m using FasterCSV to upload some csv files and create some records
based off the data in the CSV files. I''m pretty sure the problem is a
character encoding issue because the CSV is full of French and German
words. If I remove all the accents off the letters, then it uploads
fine, otherwise it just throws a...
2007 Nov 13
0
FasterCSV: ignoring returns within a db field
Hello,
my goal is to import data into a MySQL-Database using FasterCSV:
Does anyone have an idea how I can force FasterCSV to ignore carriage
returns that 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...
2009 Aug 05
1
How do I use fastercsv to just read the header row and not the whole file?
How do I use fastercsv to just read the header row and not the whole
file?
I need to read the header row first and not the whole csv file
initially in the web application so I can map the input csv columns to
the db columns. Once the mapping is complete, a rake task will than
process the whole file. I don’t want to read...
2008 Jul 18
4
gem question on hosted service
...ure someone else on
this list has seen this issue go by. I use a hosting service that has
ROR available, but I am among the few developers using it. I am
developing on a local linux box, and have been very careful to NOT use
any extra gems because I might have a problem with my provider.
Well ... fastercsv rocks and I wanted to use it.
My provider has a method for me to install a gem, and I did so with
their interface (Fansastico).
My issue:
require ''fastercsv'' does not work, and I think it''s because they put
gems in a place where ruby/rails can''t seem to find th...
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/.
2009 Nov 10
4
Model spec for file upload with paperclip and fastercsv
I just started my ImportsController and was this was really the way to
go:
////////import.rb/////////////////
class Import < ActiveRecord::Base
has_attached_file :csv
validates_attachment_presence :csv
after_save :process_csv
private
def process_csv
FasterCSV.foreach( csv.path) do |row|
#TODO
end
end
end
/////////import_spec.rb/////////////////
require ''spec_helper''
describe Import do
it "should should succeed creating a valid Import from the factory" do
import = Factory.build(:import)
import.csv.st...
2005 Dec 25
0
Simple FasterCSV question
Hello,
I must be unclear on the concept. Why is it that the following code
runs but returns no result?
def read_file
FasterCSV.foreach("./dar.csv") do |row|
STDOUT.puts row
end
end
Thanks so much,
Mike
2007 Jul 25
0
Multiple header rows with FasterCSV?
Hi,
So I''m new to RoR and have been playing around with the FasterCSV gem.
One thing I can''t figure out is how you get it to skip multiple header
rows. I can do one row no problem. But 2 or more is completely beyond
me. Any suggestions?
Cheers,
Nick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed...
2011 Mar 26
2
upload file, read first 10 lines.
I have a csv file and in my controller:
uploaded_file = params[:upload][:csv].read
@rows << FasterCSV.parse(uploaded_file)
I want to put in @rows only the first 10 lines but the read method
reads all the file.
How can I do?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYP...
2008 May 01
1
Strategy for importing temporary .csv file?
...class ImportController < ApplicationController
def aaccount_import
@owner = Owner.find(2)
n = 0
unless params[:file].nil?
fullpath = File.expand_path(params[:file]) # this doesn''t blow
up but some books say that a file object is passed and thus File
methods should apply?
FasterCSV.foreach("#{RAILS_ROOT}/convert/#{params[:file]}") do |
row|
# FasterCSV.foreach(params[:file]) do |row| # cant seem to read
submitting machines full path info?
# FasterCSV.foreach(fullpath) do |row|
c = @owner.accounts.new
c.code = row[0]
c.description =...
2005 Dec 07
4
Importing data for excel file or csv file
hey,
i have this website (with ajax also) with lot of records of employee, and as an
extra feature i want that the customer can import his employeelist (perhaps 100+
records), lot of work to do this manually.
i would create a template like this
Firstname Lastname Phone
xxxx xxxxx xxxxx
yyyy yyyyy yyyyy
then they upload the excel file or save it as csv file
2006 Mar 21
8
Loading the contents of a CSV file to a database
...iterate through a CSV file of my bank transactions and see
just how much money i spend on beer and pies every month.
I have successfully setup a database with a single table called
transactions and setup a skeleton and entered a few records using the
basic CRUD functions. I have also installed FasterCSV and successfully
listed the contents of the csv file. I thought it would be a simple step
to loop through the file and insert the values in to the db. In addition
to the generated admin_controller.rb file containing list, update etc i
put
def csv_preview
require ''faster_csv'...
2006 Jul 29
1
Debian - plugins being installed to the wrong place?
...SX) to my test environment (a dedicated Debian box in a
datacentre somewhere).
All seems to be OK except ruby Plugins don''t seem to work. When I go to
a page which uses a plugin I get errors... e.g.
uninitialized constant Paypal
Same happens with other plugins I''m using e.g. FasterCSV and PDFWriter
I''ve installed the plugins the normal way without any errors
gem install paypal
gem install pdf-writer
gem install fastercsv
but for some reason my plugins folder is still empty! don''t know where
these things are being installed to...
--John
--
Posted via h...
2009 Jan 14
1
setting header in views?
currently iam using FasterCSV to render csv pages
format.csv do
csv_string = FasterCSV.generate do |csv|
# header row
csv << @query_result[0].keys
@query_result.each do |x|
csv << x.values
end
end
#send it to the browser
send_data...