# MysqlBulkWriter issue with multiline DB column

**URL:** <https://forum.cloverdx.com/t/mysqlbulkwriter-issue-with-multiline-db-column/2116>\
**Category:** CloverDX Platform\
**Created:** [June 3, 2021, 12:00am UTC](https://forum.cloverdx.com/t/mysqlbulkwriter-issue-with-multiline-db-column/2116 "2021-06-03T00:00:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nismon8er](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@nismon8er](https://forum.cloverdx.com/u/nismon8er)\
**Post date:** [June 3, 2021, 12:00am UTC](https://forum.cloverdx.com/t/mysqlbulkwriter-issue-with-multiline-db-column/2116/1 "2021-06-03T00:00:00Z")

</div>

Hello,

I have a TEXT column in a table and I have a flat file that is ^^ delimited. There are some situations where that data look something like this

**^^1^^06/03/2021^^100.00^^This is a multiline**  
**not and it needs**  
**to remain as a multiline note^^1^^0^^**  
**^^1^^06/03/2021^^100.00^^This is a multiline**  
**not and it needs**  
**to remain as a multiline note^^1^^0^^**

But bulkwriter for some reason does not like that even though I specified that the ^^ is the delimiter.

I have used Reformat to strip out the “\n” and it works fine but boss does not want to lose the multilines.

**^^1^^06/03/2021^^100.00^^This is a multiline note and it needs to remain as a multiline note^^1^^0^^**  
**^^1^^06/03/2021^^100.00^^This is a multiline note and it needs to remain as a multiline note^^1^^0^^**

Any solution?

Thanks!

---

<div class="post-metadata">

**Author:** ![nismon8er](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@nismon8er](https://forum.cloverdx.com/u/nismon8er)\
**Post date:** [June 8, 2021, 5:35pm UTC](https://forum.cloverdx.com/t/mysqlbulkwriter-issue-with-multiline-db-column/2116/2 "2021-06-08T17:35:12Z")

</div>

Ended up solving this.

I still stripped out the “/n” but instead of replacing them with blank string “” I replaced them with a literal ‘/n’ and let the MySQL Utility handle the line break.

Worked like a charm

---

<div class="post-metadata">

**Author:** ![David\_Hlidek](https://avatars.discourse-cdn.com/v4/letter/d/58f4c7/32.png) [@David\_Hlidek](https://forum.cloverdx.com/u/David_Hlidek)\
**Post date:** [June 14, 2021, 8:55am UTC](https://forum.cloverdx.com/t/mysqlbulkwriter-issue-with-multiline-db-column/2116/3 "2021-06-14T08:55:46Z")

</div>

Hi there,

You were right, your solution works like a charm.

Let me just add to this topic, that in the replace function we might need to be aware of the right linefeed character based on the OS used. In my case, for example, I was working on a Windows machine and the linefeed is “\r\n” then. When transforming the string, I had to also escape the backslash character with another backslash so that the linefeed is replaced properly. Therefore I was able to achieve the goal by using the following function in the Reformat component:

```auto
$out.0.Field4 = replace($in.0.Field4,"\\r\\n",'\\r\\n');

```

This way the resulting field included the correct \r\n part of the string and has been interpreted by the MySQL database as a multiline string then.

Best Regards,  
Eva
