# Empty lines in exported file

**URL:** <https://community.wolfram.com/t/empty-lines-in-exported-file/7013>\
**Category:** Questions\
**Created:** [October 22, 2015, 6:49pm UTC](https://community.wolfram.com/t/empty-lines-in-exported-file/7013 "2015-10-22T18:49:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitjajancic](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mitjajancic](https://community.wolfram.com/u/mitjajancic)\
**Post date:** [October 22, 2015, 6:49pm UTC](https://community.wolfram.com/t/empty-lines-in-exported-file/7013/1 "2015-10-22T18:49:34Z")

</div>

I am producing a file using the following code:

```
finalOutput = 
  Transpose[{Drop[profilelength, 1]}~Join~
    Riffle[OPTIMUMTOP/100, OPTIMUMBTM/100]];
Export["results_\
output.txt", ToString[TableForm@finalOutput]];
SystemOpen["results_\
output.txt"]

```

Please note that `TableForm[finalOutput]` returns the table exactly as I want it to be!

However the code above returns a file with every second line completely empty. No data is missing it just has twice as much lines ad necessary. Is there a way to delete them? (see attached output file).

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [October 22, 2015, 8:28pm UTC](https://community.wolfram.com/t/empty-lines-in-exported-file/7013/2 "2015-10-22T20:28:37Z")

</div>

TableForm is meant to nice visual ascii output. This is why it inserts blank lines. You can delete the extra empty lines with StringReplace:

```
StringReplace[ToString[TableForm[{{1, 2}, {3, 4}}]], "\n\n" -> "\n"]

```

---

<div class="post-metadata">

**Author:** ![mitjajancic](https://avatars.discourse-cdn.com/v4/letter/m/ecc23a/32.png) [@mitjajancic](https://community.wolfram.com/u/mitjajancic)\
**Post date:** [October 22, 2015, 9:45pm UTC](https://community.wolfram.com/t/empty-lines-in-exported-file/7013/3 "2015-10-22T21:45:36Z")

</div>

Works really nice! Thank you!
