# DrWatson.jl: How to put a float 1e15 in the name? and how to save txt files?

**URL:** https://discourse.julialang.org/t/drwatson-jl-how-to-put-a-float-1e15-in-the-name-and-how-to-save-txt-files/49875
**Category:** General Usage
**Tags:** question, package, drwatson
**Created:** [November 9, 2020, 11:59pm UTC](https://discourse.julialang.org/t/drwatson-jl-how-to-put-a-float-1e15-in-the-name-and-how-to-save-txt-files/49875 "2020-11-09T23:59:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)
#### Post date: [November 9, 2020, 11:59pm UTC](https://discourse.julialang.org/t/drwatson-jl-how-to-put-a-float-1e15-in-the-name-and-how-to-save-txt-files/49875/1 "2020-11-09T23:59:42Z")

</div>

Hello everyone?  
As the title says, it’s a DrWatson.jl related question.  
Actually, I have 2 questions

### Question 1

Let’s say I have

```julia-auto
julia> using DrWatson
julia> params = Dict(:a=>1e15, :b=>1:23)
Dict{Symbol,Any} with 2 entries:
  :a => 1.0e15
  :b => 1:23

```

And now when I make the file name using the function savename, I get:

```julia-auto
julia> savename(params,"bson")
"a=1000000000000000.bson"

```

which obviously I would prefer to be

```julia-auto
"a=1.0e15.bson"

```

Using the scientific keyword is of no help:

```julia-auto
julia> savename(params,"bson"; scientific =3)
"a=1000000000000000.bson"

```

A similar topic was discussed in [this issue](https://github.com/JuliaDynamics/DrWatson.jl/issues/163)

Any help would be greatly appreciated.

### Question 2

Are people using DrWatson to save txt files or csv files?  
The workflow works very well for BSON files, but if anyone is using other file formats like txt or csv, I would love to see it.  
This question comes from the fact that I cannot use the function savename directly in writedlm from DelimitedFiles since the directories will not be created automatically.

Thanks again,  
Olivier

---

<div class="post-metadata">

### Author: ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)
#### Post date: [December 16, 2020, 1:55am UTC](https://discourse.julialang.org/t/drwatson-jl-how-to-put-a-float-1e15-in-the-name-and-how-to-save-txt-files/49875/2 "2020-12-16T01:55:58Z")

</div>

For 1: I see this as the same as the issue you cite, which unfortunately is still open.

For 2: One approach I use is to dispatch on `_wsave` as described here: [Saving Tools · DrWatson](https://juliadynamics.github.io/DrWatson.jl/dev/save/#Saving-Tools-1) . Specifically you could do:

```julia
DrWatson._wsave(filename, x::YourType) = writedlm(filename, x) 

```

This way you get auto-path creation by saving the file using `wsave` instead of `writedlm`, and you can also use `safesave` for free.

Although here I guess `YourType` is just `Matrix`, and the above would be Type Piracy, but given that DrWatson is an exclusively frontend package I think you can live with it…

---

<div class="post-metadata">

### Author: ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)
#### Post date: [December 16, 2020, 9:11am UTC](https://discourse.julialang.org/t/drwatson-jl-how-to-put-a-float-1e15-in-the-name-and-how-to-save-txt-files/49875/3 "2020-12-16T09:11:01Z")

</div>

Thanks a lot!  
That’s very helpful.  
I’ll try this
