# (urgent) Converting a list of decimals to float in CSV

**URL:** https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772
**Category:** Logstash
**Created:** [March 30, 2021, 10:57am UTC](https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772 "2021-03-30T10:57:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![shafeeka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shafeeka/32/85555_2.png) [@shafeeka](https://discuss.elastic.co/u/shafeeka)
#### Post date: [March 30, 2021, 10:57am UTC](https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772/1 "2021-03-30T10:57:56Z")

</div>

```auto
   mutate {
        convert => {
            "Question_Vector" => "float_eu"
        }

```

I am trying to push a CSV file to elasticsearch using logstash. One of the column contains a list of vectors and I am trying to convert it to float. I have tried float and float\_eu but both does not work. Either returns 0.0 or just the first decimal in the list.

example of record in csv: -0.04749248921871185, -0.048509035259485245, -0.024459611624479294,.... (512 dim)

please help

---

<div class="post-metadata">

### Author: ![Shaoranlaos](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@Shaoranlaos](https://discuss.elastic.co/u/Shaoranlaos)
#### Post date: [March 30, 2021, 11:57am UTC](https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772/2 "2021-03-30T11:57:11Z")

</div>

Try to use a split before this so that it the single string will be converted to an array of values.  
You should use a separate mutate filter because i'm not sure if split will be done before convert.

```auto
    mutate {
       split => { "fieldname" => "," }
    }

```

> **[Mutate filter plugin | Logstash Reference \[6.2\] | Elastic](https://www.elastic.co/guide/en/logstash/6.2/plugins-filters-mutate.html#plugins-filters-mutate-split)**

---

<div class="post-metadata">

### Author: ![carolynperry](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolynperry](https://discuss.elastic.co/u/carolynperry)
#### Post date: [March 30, 2021, 12:17pm UTC](https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772/3 "2021-03-30T12:17:30Z")

</div>

this is really good, i will try to use it

---

<div class="post-metadata">

### Author: ![shafeeka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shafeeka/32/85555_2.png) [@shafeeka](https://discuss.elastic.co/u/shafeeka)
#### Post date: [March 31, 2021, 12:37am UTC](https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772/4 "2021-03-31T00:37:46Z")

</div>

Thank you! This helped.

---

<div class="post-metadata">

### Author: ![carolynperry](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@carolynperry](https://discuss.elastic.co/u/carolynperry)
#### Post date: [April 24, 2021, 9:14am UTC](https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772/5 "2021-04-24T09:14:11Z")

</div>

i will try to use it [get-vidmateapp.com](https://get-vidmateapp.com/)[get-mobdroapk.com](https://get-mobdroapk.com/)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 22, 2021, 9:14am UTC](https://discuss.elastic.co/t/urgent-converting-a-list-of-decimals-to-float-in-csv/268772/6 "2021-05-22T09:14:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
