# Is there no standard way to read files with fixed width columns in the new DataFrames ecosystem?

**URL:** https://discourse.julialang.org/t/is-there-no-standard-way-to-read-files-with-fixed-width-columns-in-the-new-dataframes-ecosystem/7324
**Category:** Data
**Created:** [November 26, 2017, 5:39pm UTC](https://discourse.julialang.org/t/is-there-no-standard-way-to-read-files-with-fixed-width-columns-in-the-new-dataframes-ecosystem/7324 "2017-11-26T17:39:50Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [November 27, 2017, 6:43am UTC](https://discourse.julialang.org/t/is-there-no-standard-way-to-read-files-with-fixed-width-columns-in-the-new-dataframes-ecosystem/7324/3 "2017-11-27T06:43:01Z")

</div>

> [@NickNack](#):
>
> lacks the flag to “treat consecutive whitespace delimiters as one” that would be required to make it handle fixed width data

Using delimited data tools may be a workaround, but they are not right for the job.

It is very easy to roll your own tools for fixed data, see this topic:

> [@Reading Fixed-Width Column Data](https://discourse.julialang.org/t/reading-fixed-width-column-data/4020):
>
> Hi All, I’m trying to read in a file with rows that look like 13 MEXICO 130971 14 INDONESIA 126582 15 UNITED KINGDOM 114486 Note the possible presence of spaces in the 2nd column. I haven’t been able to find any tool that will easily do this for me (saw [this](https://github.com/JuliaLang/julia/issues/5391), but the suggestion there doesn’t work here). Does one exist that I’m not finding, or do I hav…

That said, fixed width datasets are usually the ugliest to deal with. In the best cases, there is some metadata which tells you the first line of data and the column layout, but there is not widely used standard format (social security data sometimes uses something called `DDF`, but that is not a well-defined format anyway).

I would simply try to get the data in another format, or use a command line tool like `sed` to replace contiguous whitespace with `,` or similar, then read it as `CSV`.

---

_[View the full topic](https://discourse.julialang.org/t/is-there-no-standard-way-to-read-files-with-fixed-width-columns-in-the-new-dataframes-ecosystem/7324)._
