<commit_before>= README

by <NAME>

== DESCRIPTION:

CsvMapper is a small library intended to simplify the common steps involved with importing CSV files to a usable form in Ruby.

== EXAMPLES:

The following example will import a CSV file to an Array of OpenStruct[http://ruby-doc.org/core/classes/OpenStruct.html] instances.

==== Example CSV File Structure

  First Name,Last Name,Age
  John,Doe,27
  Jane,Doe,26
  Bat,Man,52
  ...etc...

==== Simple Usage Example
  include CsvMapper

  results = import('/path/to/file.csv') do
    start_at_row 1
    [first_name, last_name, age]
  end

  results.first.first_name  # John
  results.first.last_name   # Doe
  results.first.age         # 27

==== Import to ActiveRecord Example
Although CsvMapper has no dependency on ActiveRecord; it's easy to import a CSV file to ActiveRecord models and save them.

  # Define an ActiveRecord model
  class Person < ActiveRecord::Base; end

  include CsvMapper
  
  results = import('/path/to/file.csv') do
    map_to Person # Map to the Person ActiveRecord class (defined above) instead of the default OpenStruct.
    after_row lambda{|row, person| person.save }  # Call this lambda and save each record after it's parsed.
		
    start_at_row 1
    [first_name, last_name, age]
  end
	
See CsvMapper for a more detailed description
	
== REQUIREMENTS:

FasterCSV[http://fastercsv.rubyforge.org/]

== INSTALL:

* TBD

== LICENSE:

(The MIT License)

Copyright (c) 2008 <NAME>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,<commit_msg>updated install to reflect gem installation from rubyforge<commit_after>= README

by <NAME>

== DESCRIPTION:

CsvMapper is a small library intended to simplify the common steps involved with importing CSV files to a usable form in Ruby.

== EXAMPLES:

The following example will import a CSV file to an Array of OpenStruct[http://ruby-doc.org/core/classes/OpenStruct.html] instances.

==== Example CSV File Structure

  First Name,Last Name,Age
  John,Doe,27
  Jane,Doe,26
  Bat,Man,52
  ...etc...

==== Simple Usage Example
  include CsvMapper

  results = import('/path/to/file.csv') do
    start_at_row 1
    [first_name, last_name, age]
  end

  results.first.first_name  # John
  results.first.last_name   # Doe
  results.first.age         # 27

==== Import to ActiveRecord Example
Although CsvMapper has no dependency on ActiveRecord; it's easy to import a CSV file to ActiveRecord models and save them.

  # Define an ActiveRecord model
  class Person < ActiveRecord::Base; end

  include CsvMapper
  
  results = import('/path/to/file.csv') do
    map_to Person # Map to the Person ActiveRecord class (defined above) instead of the default OpenStruct.
    after_row lambda{|row, person| person.save }  # Call this lambda and save each record after it's parsed.
		
    start_at_row 1
    [first_name, last_name, age]
  end
	
See CsvMapper for a more detailed description
	
== REQUIREMENTS:

FasterCSV[http://fastercsv.rubyforge.org/]

== INSTALL:

* sudo gem install csv-mapper

== LICENSE:

(The MIT License)

Copyright (c) 2008 <NAME>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
{'fraction_non_alphanumeric': 0.08120258499578534, 'fraction_numerical': 0.007867378477100308, 'mean_word_length': 3.8767123287671232, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2424015', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1025, 'n_words': 417}