# I'm building a database using 'csv', I need to have the program read the tables and calculate the constraint and goal indices, to get the optimal solution, which commands should I use?

**URL:** <https://discourse.julialang.org/t/im-building-a-database-using-csv-i-need-to-have-the-program-read-the-tables-and-calculate-the-constraint-and-goal-indices-to-get-the-optimal-solution-which-commands-should-i-use/10759>\
**Category:** Optimization (Mathematical)\
**Created:** [May 7, 2018, 1:43pm UTC](https://discourse.julialang.org/t/im-building-a-database-using-csv-i-need-to-have-the-program-read-the-tables-and-calculate-the-constraint-and-goal-indices-to-get-the-optimal-solution-which-commands-should-i-use/10759 "2018-05-07T13:43:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaquelSantos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raquelsantos/32/3668_2.png) [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Post date:** [May 7, 2018, 1:43pm UTC](https://discourse.julialang.org/t/im-building-a-database-using-csv-i-need-to-have-the-program-read-the-tables-and-calculate-the-constraint-and-goal-indices-to-get-the-optimal-solution-which-commands-should-i-use/10759/1 "2018-05-07T13:43:27Z")

</div>

I’m building a database using ‘csv’, I need to have the program read the tables and calculate the constraint and goal indices, to get the optimal solution, which commands should I use?

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 7, 2018, 1:49pm UTC](https://discourse.julialang.org/t/im-building-a-database-using-csv-i-need-to-have-the-program-read-the-tables-and-calculate-the-constraint-and-goal-indices-to-get-the-optimal-solution-which-commands-should-i-use/10759/2 "2018-05-07T13:49:08Z")

</div>

Most of that sounds like it’s specific to your problem and difficult to give guidance on without more detail.

Surely you’ll want to use [CSV.jl](https://github.com/JuliaData/CSV.jl) for parsing the `csv`’s. You’ll probably also want to familiarize yourself with [DataFrames.jl](https://github.com/JuliaData/DataFrames.jl) which is nice and light-weight and simple. They actually play fairly nicely with optimization problems due to the fact that their columns are just `AbstractVector`s.

(I was assuming here that you were talking about using your own csv’s, and not one of the optimization format files.)

---

<div class="post-metadata">

**Author:** ![RaquelSantos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raquelsantos/32/3668_2.png) [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Post date:** [May 7, 2018, 2:04pm UTC](https://discourse.julialang.org/t/im-building-a-database-using-csv-i-need-to-have-the-program-read-the-tables-and-calculate-the-constraint-and-goal-indices-to-get-the-optimal-solution-which-commands-should-i-use/10759/4 "2018-05-07T14:04:39Z")

</div>

Yes, I am using a csv that I created and exported, I am already using DataFrames.jl, but I would like the program to read only the field and assign the values to the field, for example:

* * *

## | Table: Toy | Table: Profit |

## | Ball | 12 |

## | Doll | 60 |

In the case, I would like the program to take only the names Toy and Profit, and assign the objective function, without putting the values in the code, and the same would be for the constraints.  
(Not if I could explain perfect what I’m thinking of doing)
