I would like to replace two carriage returns (\n\n) with a carriage return and a tab (\n\t) in Google Docs (regular document NOT a spreadsheet). If I enter \n\t in replace with the simple text, as typed, is inserted, not the nonprinting characters. Is this a Google Doc limitation or is there a way to get around it?
Replace \n\n with \n\t in Google Docs
Asked Answered
can you add an example of your input text ? –
Altercation
\n\n in replace and \n\t in replace with. The pattern is found, yet the replacement is \n\t as text instead of the breakline and lead space at the beginning of the next line as expected –
Coheir
Do you mean you are inside an open Google Document, and are using the Search and Replace dialog (Ctrl+H)? –
Heinie
Yes! That's it... –
Coheir
You can't do this from inside the Google Docs UI; it doesn't provide a way to specify the actual newline and tab characters for replacement.
That's so inconvenient. Anyone who lands here please follow the advice in support.google.com/docs/thread/8197972?hl=en&msgid=8201646 to use "Help > Help Doc Improve" to send them feedback that we need to get the replace function to accept the special character as a replacement, e.g. \n\t as newline and tab characters for replacement when the RE match is turned on. –
Christianachristiane
Looked for this all morning and finally found a response here: https://support.google.com/docs/thread/246167941/how-can-i-remove-double-paragraph-breaks-from-a-large-document?hl=en
Go Mr. Shane! Here's the text in case the article disappears:
*I recommend you make a copy of the file before attempting the following suggestion.
- Open the Find and replace tool.
- Place a check-mark next to "Use regular expressions (e.g. \n for newline, \t for tab)"
- Enter this into the "Find" box: \n(?=\n)
- Leave "Replace with" empty (that means do NOT put anything into the box). Click "Replace all"*
Thank you for the effort, but that does not address the OP's problem. The issue doesn't lie on searching for
\n\n
, but rather in replacing it with \n\t
. –
Abroach You can by
- Ctrl+H then
\n+
(46hex code) for search
OR
- search
\n\s
- replace with whatever you want
The question specified searching for for \n\n not \n\s. The question was asking how to replace with \n\t and this is not currently supported. As the question states, Google Docs replaces with the actual characters "\n\t" and not a newline and a tab. Your answer does not address the question and your suggested solution does not work. –
Aceae
© 2022 - 2024 — McMap. All rights reserved.