# Carriage return and float to integer

**URL:** <https://discuss.elastic.co/t/carriage-return-and-float-to-integer/98106>\
**Category:** Logstash\
**Created:** [August 23, 2017, 4:16pm UTC](https://discuss.elastic.co/t/carriage-return-and-float-to-integer/98106 "2017-08-23T16:16:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beuhlet\_Reseau](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Beuhlet\_Reseau](https://discuss.elastic.co/u/Beuhlet_Reseau)\
**Post date:** [August 23, 2017, 4:16pm UTC](https://discuss.elastic.co/t/carriage-return-and-float-to-integer/98106/1 "2017-08-23T16:16:19Z")

</div>

Hello,

I try to upload new type of data.

In flat files on format csv, each ten lines i have a r **eturn carriage**.

```
101;2907035;/suivi_message_alerte;3;150328;150390;101;853531;/acc1200;0;0;;1593384;00;150330;0;2
101;290371;/sualerte;3;15049;15384;L;L;101;29242;/a00;0;0;172800;15035
$  
101;29293;/suierte;3;1503393448;150339;101;31954;/acco1200;0;-3505;172800;15;15005;00;153508;0;1

```

I thought to use if condition like that :

```
if [message] =~ "\n" {
      drop { }
    }

```

What do you think ?

Also :

In my files i have sometimes float number like 82,134576 or 91,23445 or 99,49565

I want integer number with rounded number, example for :

82,134576 =\> 80  
91,23445 =\> 90  
99,49565 =\> 90

I know, if i define mapping in elasticsearch at "valuefloat" type = integer, 82,134 become 82 but i want really 80.

The must have will be :

82,134576 =\> 80  
91,23445 =\> 80  
99,49565 =\> 80

It's possible ?

To remove line if a specific field are null/blank i can use this no ?

if [mandatory\_value] = null {  
drop {[message]}  
}

Also, about phone number. If i have phone number under this for "00033632345487", can i format to 33632345487 ? I am not expert in regex...

---

<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:** [September 20, 2017, 4:16pm UTC](https://discuss.elastic.co/t/carriage-return-and-float-to-integer/98106/2 "2017-09-20T16:16:54Z")

</div>

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