Skip to main content
Solved

Excel writer problem when writing data that has multiple lines


sebastianolaf
Forum|alt.badge.img

I have oracle table that needs to be exported to excel

the table has 1 column that has multiple line

Excel Writer is good enough to make it into 1 line automatically.

 

But the 2 words that separated by New Line or Carriage Return became 1 word instead split it with single space.

For Example an address Column:

"Hello

 

World"

Excel Write put it in 1 cell "HelloWorld"

no space between

"Hello" and World"

How to tell Excel Writer not to do that ?

Expected Result "Hello World" with space in the middle

 

Best answer by takashi

Hi @sebastianolaf, if it's allowed to replace carriage return and/or new line with a single space, it would also be a workaround to use the StringReplacer with this setting. The regex '\\s+' matches one or more consecutive white-space characters including carriage return and new line.

  • Mode : Replace Regular Expression
  • Text to Replace: \\s+
  • Replace Text: <enter a space>
View original
Did this help you find an answer to your question?

6 replies

david_r
Evangelist
  • January 29, 2018

In the folumn formatting dialog, make sure you set the Text Control to "Wrap text":


sebastianolaf
Forum|alt.badge.img
david_r wrote:

In the folumn formatting dialog, make sure you set the Text Control to "Wrap text":

Hi @david_r

 

 

I tried, it still the same.

 

 

 


david_r
Evangelist
  • January 29, 2018

Weird, works for me.

What happens if you open the output in Excel, select the column and hit the Wrap Text format button?

My impression is that the newlines are indeed written by FME, and that it's a formatting issue in Excel.


takashi
Influencer
  • Best Answer
  • January 29, 2018

Hi @sebastianolaf, if it's allowed to replace carriage return and/or new line with a single space, it would also be a workaround to use the StringReplacer with this setting. The regex '\\s+' matches one or more consecutive white-space characters including carriage return and new line.

  • Mode : Replace Regular Expression
  • Text to Replace: \\s+
  • Replace Text: <enter a space>

sebastianolaf
Forum|alt.badge.img
david_r wrote:

Weird, works for me.

What happens if you open the output in Excel, select the column and hit the Wrap Text format button?

My impression is that the newlines are indeed written by FME, and that it's a formatting issue in Excel.

Hm, I tried ran several times

 

It works after couple of try, I don't stand it either,

 

the 1st screenshot didn't refresh the excel, 2nd then ok

 

I didn't change the edit settings

 

 

Thank you

 

 


sebastianolaf
Forum|alt.badge.img
takashi wrote:

Hi @sebastianolaf, if it's allowed to replace carriage return and/or new line with a single space, it would also be a workaround to use the StringReplacer with this setting. The regex '\\s+' matches one or more consecutive white-space characters including carriage return and new line.

  • Mode : Replace Regular Expression
  • Text to Replace: \\s+
  • Replace Text: <enter a space>
I also tried this way,

 

it works but i use '(\\n+)'

 

 

Thank you

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings