Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vizir/generic_csv_importer
https://github.com/vizir/generic_csv_importer
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vizir/generic_csv_importer
- Owner: Vizir
- Created: 2014-09-30T18:16:46.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-01T14:14:27.000Z (over 10 years ago)
- Last Synced: 2024-03-26T20:22:30.970Z (10 months ago)
- Language: Ruby
- Size: 141 KB
- Stars: 2
- Watchers: 70
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A csv importer gem.
## Usage
```ruby
model_name = "Person"
csv_file = CSV.read("/home/user/person.csv", {:col_sep => ",", :headers => true} )g = GenericCsvImporter.new
g.import(csv_file, model_name)
```## CSV example
Person belongs to Class
```
Person.name,Person.age,Class.number
John,9,10
Mary,8,15
```## Contributing
1. Fork it ( https://github.com/Vizir/generic_csv_importer/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request