add new columns in csv file

Psudo code:

FasterCSV.parse(file, parse_options) do |row|
// hanle header
if header
row.push(“new col”)
next
end
// handle the column value of the “new column”
row.push(“column_value”)
end

push(*args)

A shortcut for appending multiple fields. Equivalent to:

args.each { |arg| faster_csv_row << arg }

This method returns the row for chaining.

[Source]

# File lib/faster_csv.rb, line 253
def push(*args)
args.each { |arg| self << arg }

self # for chaining
end

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s