Remove line breaks from an excel file

Hi

Line breaks in cells of an excel workbook are creating issues with labelling in easymorph, cutting off the text after the linebreak. Any way of removing them?

Rob

Hello Rob,

We are looking into the problem and we will fix it ASAP.

Thanks, Andrew

It seems that text with line breaks is not cut off. It just doesn’t displayed in the data grid.

You can display the whole column name in the sidebar by clicking at the column header:

And you can display the whole cell text by choosing “Metadata” in the cell’s context menu:

If you need to remove line breaks from a few column names, you can just use “Rename columns” transformation:

And if you need to remove line breaks from a lot of columns, you can use “Rename columns with lookup” transformation as displayed in the following example project:

LineBreaks.morph (3.7 KB)
LineBreaks.xlsx (7.8 KB)

This projects create list of column names by applying “Trim” (Keep 1 top row) and “Unpivot” transformations. Then it uses “Calculate new column(s)” transformation with the following expression:

replace([Old column names], char(10), ' ')

to remove line breaks from the said list and store modified column names in a new column. Afterwards project applies “Rename columns with lookup” to the initial dataset and uses lists of old and new column names as a lookup table.

Also can remove line breaks from cell values by applying “Modify column(s)” transformation with the following expression:

replace([ColumnName], char(10), ' ')