# What is the best way to read a CSV file

**URL:** <https://discourse.julialang.org/t/what-is-the-best-way-to-read-a-csv-file/68086>\
**Category:** New to Julia\
**Tags:** csv, io\
**Created:** [September 13, 2021, 10:44am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-read-a-csv-file/68086 "2021-09-13T10:44:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdcpereira](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hdcpereira/32/28705_2.png) [@hdcpereira](https://discourse.julialang.org/u/hdcpereira)\
**Post date:** [September 13, 2021, 10:44am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-read-a-csv-file/68086/1 "2021-09-13T10:44:29Z")

</div>

Hello there!

My question is, I have a dataset in a csv file and I would like to know what is the best way to load it in memory.  
As an example, lets say I have the following columns:

```julia
time -> datetime
mag_field -> float
mot -> boolean

```

I know I could easily use

```julia
using DataFrames
using CSV

file = "data.csv"
my_data = CSV.File(file)

```

But what is the best way to, for example, when importing, letting CSV.File know what are the data types inside my file, get the column names properly.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [September 13, 2021, 11:21am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-read-a-csv-file/68086/2 "2021-09-13T11:21:04Z")

</div>

You’re in luck, the CSV docs have just been rewritten! Please head over here to have all your questions (and more!) answered:

[https://csv.juliadata.org/stable/reading.html#types](https://csv.juliadata.org/stable/reading.html#types)
