csv_processor
Version, currently master branch1 version
- master branchlatestAug 15, 2018
github.com/drum445/csv_processor
CSV Processor in Crystal
3 stars
1 dependent
License: MIT
Installation
# Add this to your shard.yml
dependencies:
csv_processor:
github: drum445/csv_processor
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.24.2- License
- MIT
- Author
- er
Dependencies
This version declares no dependencies.
README
csv_processor
Allows manipulation of CSV files based on the columns headerHeader == Column Name
Installation
Add this to your application's shard.yml:
dependencies:
csv_processor:
github: drum445/csv_processor
Usage
Using a file that looks like (test.csv):
name,age,gender
ed,23,m
bert,42,m
dave,55,m
Setup
require "csv_processor"
csv = CSVProcessor::CSVP.new("test.csv")
csv.read_file
Changing a value
# loop through our records and change the age
# of the record belonging to ed
csv.records.each do |row|
if row["name"] == "ed"
row["age"] = "35"
end
end
Renaming a column header
csv.rename_column("age", "years")
Adding a column then setting the value
csv.add_column("job")
csv.records.each do |row|
row["job"] = "developer"
end
Deleting a column
csv.delete_column("age")
Write to file
csv.write_file("processed_file.csv")
Contributing
- Fork it ( https://github.com/drum445/csv_processor/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- drum445 er - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Aug 15, 2018
- Crystal
0.24.2- Indexed
- yes
Dependents
Repository
github.com/drum445/csv_processor
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1