Copy text with italics into calc

My first use of this forum - Working to convert from MS Office to Libreoffice.
I have an Excel tool that accepts up to several thousands of lines of text that originates on a web page. Each line of text might contain a word in italics and the location of the italics in that line is unpredictable. My Excel tool parses each line of text, basically placing each word or other value into a separate column including placing the italics text into its own column. Every copy-paste option I have tried loses the italics. However, if I manually change the appropriate text to italics, the macro that looks for the italics finds it and processes it appropriately. Appreciate any suggests as to how to not lose the italics in the paste operation.

Running Windows 10 Pro, Libreoffice 24.2.5.2

If you paste into Writer and copy from there, you can paste with formatting retained

I did try that - but about 100 lines/rows of text all went into cell A1. The italics was retained but I need each row of text in a separate cell and copying one row at a time for potentially 1000s of rows is obviously impractical.

Select the cell only, don’t double click it to enter Cell Edit Mode

I found the problem - don’t quite know what to do about it yet. Using my Excel tool, I do start dropping the text into Word or Excel loses the italics too. However, Excel recognizes each row of text coming out of Word as a separate line and puts each row of text in a separate cell. If, having copied the text off of the web into Writer and then manually entering a hard carriage return at the end of each line in Writer and then pastne the result into calc then each row of text goes into a separate cell.

To replace line feeds with paragraph breaks in Writer,

  1. click Edit > Find and Replace
  2. Expand Other Options and tick the box Regular expressions
  3. in the Find field enter \n
  4. in the Replace field enter \n
  5. click Replace All

That works - Thank you!

1 Like