# CSVFiles: read file with non-standard extension

**URL:** https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096
**Category:** General Usage
**Created:** [November 28, 2018, 12:16pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096 "2018-11-28T12:16:08Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jtackm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jtackm/32/4784_2.png) [@jtackm](https://discourse.julialang.org/u/jtackm)
#### Post date: [November 28, 2018, 12:16pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096/1 "2018-11-28T12:16:08Z")

</div>

I’m trying to use CSVFiles.jl to read a .tsv file that has a non-standard file extension (which cannot easily be changed).

The readme suggests

```julia
df = DataFrame(load(Stream(format"CSV", io)))

```

But trying to apply this pattern results in the following error:

```julia
path = "/file/tree/my_nonstandard_file.1b"
f = open(path)
df = load(Stream(format"CSV", f)) |> DataFrame
head(df)

```

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/b/db3c7454d52797e88f1debc91aa4e473d7c268f6.png)

What am I doing wrong here?

(By the way, I know there are alternatives (CSV.jl, DelimitedFiles etc.), but I would like to make CSVFiles work in this case)

---

<div class="post-metadata">

### Author: ![ImreSamu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/imresamu/32/20677_2.png) [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)
#### Post date: [November 28, 2018, 1:22pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096/2 "2018-11-28T13:22:56Z")

</div>

> [@jtackm](#):
>
> I’m trying to use CSVFiles.jl to read a .tsv

( I am not tested )

but, based on the : [https://github.com/queryverse/CSVFiles.jl/blob/master/test/runtests.jl#L128](https://github.com/queryverse/CSVFiles.jl/blob/master/test/runtests.jl#L128)  
can you test with

- `fileiostream = FileIO.Stream(FileIO.format"TSV", stream)`

so with: `format"TSV"`

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [November 28, 2018, 1:40pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096/3 "2018-11-28T13:40:31Z")

</div>

> [@jtackm](#):
>
> But trying to apply this pattern results in the following error:

Seems to be a bug in TextParse.jl: [just use String(read(f)), not String(Mmap.mmap(f)) by stevengj · Pull Request #86 · queryverse/TextParse.jl · GitHub](https://github.com/JuliaComputing/TextParse.jl/pull/86)

---

<div class="post-metadata">

### Author: ![jtackm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jtackm/32/4784_2.png) [@jtackm](https://discourse.julialang.org/u/jtackm)
#### Post date: [November 28, 2018, 1:48pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096/4 "2018-11-28T13:48:50Z")

</div>

> [@ImreSamu](#):
>
> so with: `format"TSV"`

Unfortunately does not work either.

> [@stevengj](#):
>
> Seems to be a bug in TextParse.jl:

I see, then I’ll wait for the merge. Thanks!

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [November 28, 2018, 4:16pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096/5 "2018-11-28T16:16:05Z")

</div>

Can you try

```julia
using CSVFiles, DataFrames, FileIO

path = "/file/tree/my_nonstandard_file.1b"
df = load(File(format"TSV", path)) |> DataFrame

```

---

<div class="post-metadata">

### Author: ![jtackm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jtackm/32/4784_2.png) [@jtackm](https://discourse.julialang.org/u/jtackm)
#### Post date: [November 28, 2018, 4:32pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096/6 "2018-11-28T16:32:36Z")

</div>

> [@davidanthoff](#):
>
> Can you try

Works like a charm! Maybe this could be reflected in the README.md of CSVfiles.

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [November 28, 2018, 8:55pm UTC](https://discourse.julialang.org/t/csvfiles-read-file-with-non-standard-extension/18096/7 "2018-11-28T20:55:51Z")

</div>

[https://github.com/queryverse/CSVFiles.jl/issues/36](https://github.com/queryverse/CSVFiles.jl/issues/36)
