search for: csv_file

Displaying 6 results from an estimated 6 matches for "csv_file".

2009 Jun 23
2
syntax error, unexpected tINTEGER, expecting $end
...t.column :city, :string 8. t.column :state, :string 9. t.column :county, :string 10. t.column :type, :string 11. end 12. add_index "geo_data", ["zip_code"], :name => "zip_code_optimization" 13. 14. csv_file = "#{RAILS_ROOT}/db/migrate/geo_data.csv" 15. fields = ''(zip_code, latitude, longitude, city, state, county, type)'' 16. 17. # execute "LOAD DATA INFILE ''#{csv_file}'' INTO TABLE geo_data FIELDS " + 18. # "TERMINATED...
2018 Apr 19
1
Syntax for capturing and writing file names
Hi all, I am looking for syntax to read a list of *txt files, (loop through?) each with a different data content but same fields, then run lines of code to produce summary stats (I have working code for this) and add the matching data file name when writing the results of a line of R code.?? Suggestions on any package vignettes that may be useful welcomed. My manual code for this is below
2006 Feb 06
4
Memory Issue while looping through CSV file
...stantate a new object for each record I am using more memory but thought I was using reusing the same memory allocated. Anyway, I''m a little new with Ruby and Rails so if you can tell me where I''m going wrong that would be much appreciated. I have included the code below. Thanks! csv_file = CSV.open(CSV_PATH, "r") csv_file.each do | pattern_temp | unless pattern_temp[0].nil? pattern_record = { :code => pattern_temp[0].delete("\""), :designer => pattern_temp[1], :name => pattern_temp[2], :designs => pattern_temp[3], :pri...
2007 Jun 06
2
lookup in CSV recipe
I await Luke''s node settings implementation with interest. At the moment however, I have this sort of ugliness: $site = $hostname ? { fred => "opsera", barney => "bedrock", default => "unknown site", ... } So I''ve knocked up this little function to use CSV files instead. Now I can just do: $site =
2012 Oct 22
4
Possible to exclude an event in Puppet dashboard?
...run, but actually I want to exclude this from showing up as "CHANGED" Is this possible, if so how can I achieve this? --- myscript: --- exec { "run_myscript" : # run myscript command => "/usr/bin/env ruby ${my_script} ${csv_files}", cwd => "${myscript_dir}", timeout => 0, logoutput => "on_failure", } -- Regards, Martin Willemsma -- You received this message because you are subscribed to the Google Groups "Puppet Users" g...
2010 Apr 14
3
PGError: duplicate key
...at, when I try to add new data to any of these tables via Table.new I get a PGError on duplicate key. For example: MIGRATION: class CreateNumbers < ActiveRecord::Migration def self.up create_table :numbers do |t| t.string :name t.integer :value t.timestamps end csv_file = "#{Rails.root}/db/migrate/numbers.csv" fields = ''(name, number)'' execute "COPY numbers from ''#{csv_file}'' DELIMITERS '','' CSV;" end def self.down drop_table :numbers end end CSVFILE: 1, "one", 1...