how to handle embedded newlines in data frame write to cube #1228
-
I'm importing a spreadsheet with variance comments. The comments are not heavily formatted, but they do contain embedded blank lines to separate the comments into paragraphs. I've read the data into a pandas data frame using read_excel That seemed to work fine. However, when i write the data to tm1 using the write_dataframe function and then try to display the data in excel using a DBRW formula I do not see my new lines. I'm in a windows world, but it looks like the data may have stripped out the \r and only have a \n. Is there a flag that I should be providing, or a different best practice approach? I imagine this is not an unusual requirement. Thanks for advice!!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Please try explicitly setting the newline characters before sending it to TM1. # Read Excel
df = pd.read_excel("your_file.xlsx")
df['Comments'] = df['Comments'].str.replace('\n', '\r\n')
# Write to TM1
tm1.write_dataframe("YourCube", df) |
Beta Was this translation helpful? Give feedback.
Please try explicitly setting the newline characters before sending it to TM1.