Problem: Imported document has many extra carriage returns (or line returns or paragraph returns) at the end of Object Text. |
Re: Remove/Replace/Delete Carriage Returns/Line Returns/paragraph returns I made something like this a while ago. My guess that what you imported in was rich text and not plain text. Rich text has the carriage returns as \par instead of \n. I'll attach some code that might work. It first filters for objects with multiple carriage returns and then strips the last carriage return off. You might have to run it several times to strip all the carriage returns off. The searchDouble/fixDouble is used for plain text, the searchExtra and fixExtra is for rich text. Currently the plain text fix is commented out. Greg Attachments attachment_14972955_FixExtraNewLines.dxl |
Re: Remove/Replace/Delete Carriage Returns/Line Returns/paragraph returns
Hi Regexp regSplit = regexp2("^([^\n]*)\n(.*)$"); string sTest = "123\n456"; if(regSplit(sTest)) { print "0: " sTest[match 0] "\n"; print "1: " sTest[match 1] "\n"; print "2: " sTest[match 2] "\n"; }
0: 123 456 1: 123 2: 456
|
Re: Remove/Replace/Delete Carriage Returns/Line Returns/paragraph returns In your case you want to do that work in Word before you import it; typically:
-Louie |
Re: Remove/Replace/Delete Carriage Returns/Line Returns/paragraph returns I will still tell folks to be more careful when cutting and pasting new text. |
Re: Remove/Replace/Delete Carriage Returns/Line Returns/paragraph returns Hello, What I am tring to do is to output from DOORS the text with the RTF settings preserved. Issue is that when I use the commands to copy to the clipboard an extra line feed is added. What I need to do is to remove this line feed before pasting from the clipboard. I have stumbled across this topic before, but it was not of interest to me at that time. Try as I can now, I cannot find the posting. If possible, would you please send me the link to the post answering this question? Thanks in advance. |