# Reading data text files delimited with both spaces & tabs

**URL:** <https://discourse.julialang.org/t/reading-data-text-files-delimited-with-both-spaces-tabs/64851>\
**Category:** General Usage\
**Tags:** csv, io\
**Created:** [July 18, 2021, 10:49am UTC](https://discourse.julialang.org/t/reading-data-text-files-delimited-with-both-spaces-tabs/64851 "2021-07-18T10:49:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [July 18, 2021, 11:54am UTC](https://discourse.julialang.org/t/reading-data-text-files-delimited-with-both-spaces-tabs/64851/3 "2021-07-18T11:54:19Z")

</div>

@GunnarFarneback, thanks for your response. The result is a matrix of Any that needs further parsing in order to use the convenience tools in DataFrames and DataFramesMeta to handle missings, etc. (_my input example was too simple_).

The following code (adapted from [here](https://discourse.julialang.org/t/converting-a-matrix-to-a-dataframe/6114/4)) converts the matrix of Any into a dataframe, allowing further processing as indicated.

It does not seem to be as “efficient” as CSV.jl (_where there is a lot of machinery for handling types, etc._) but it works and will mark your response as a solution, if no other ideas pop up.

```julia
using DelimitedFiles
M = readdlm(file)
header = M[1,:]
data = M[2:end,:]
df = DataFrame(data,:auto)
rename!(df, names(df) .=> Symbol.(header[:]))

```

Thanks.

---

_[View the full topic](https://discourse.julialang.org/t/reading-data-text-files-delimited-with-both-spaces-tabs/64851)._
