# Inserting CSV into postgres

**URL:** <https://forum.elixirforum.com/t/inserting-csv-into-postgres/3606>\
**Category:** Questions\
**Tags:** ecto, streams\
**Created:** [February 8, 2017, 4:58pm UTC](https://forum.elixirforum.com/t/inserting-csv-into-postgres/3606 "2017-02-08T16:58:42Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![sabri](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sabri/32/9683_2.png) [@sabri](https://forum.elixirforum.com/u/sabri)\
**Post date:** [February 11, 2017, 3:12pm UTC](https://forum.elixirforum.com/t/inserting-csv-into-postgres/3606/9 "2017-02-11T15:12:45Z")

</div>

Ok, here is my humble try with a CSV file that has 100 entry like:

CSV:

> seq,first,last,email,digit  
> [1,Antonio,Martinez,femeise@bi.gov](mailto:1,Antonio,Martinez,femeise@bi.gov),348429376  
> [2,Robert,Butler,amfob@vaim.io](mailto:2,Robert,Butler,amfob@vaim.io),738848051

Code:

```
NimbleCSV.define(MyParser, separator: ",", escape: "\"")
File.stream!("/Users/samir/Downloads/100.csv")
|> MyParser.parse_stream
|> Stream.chunk(10)
|> Task.async_stream(&MyApp.CsvsController.chunk_handler_fn/1)

def chunk_handler_fn(csv_row) do
    IO.puts csv_row
end

```

But, `chunk_handler_fn` was never called, I have attached the simple `100.csv` sample file here:

[https://s3.eu-central-1.amazonaws.com/test-files-74/100.csv](https://s3.eu-central-1.amazonaws.com/test-files-74/100.csv)

Is there something I have missed?

---

_[View the full topic](https://forum.elixirforum.com/t/inserting-csv-into-postgres/3606)._
