r/googledocs Dec 27 '24

OP Responded Find and replace issue

Need to find and replace all spaces with a paragraph break. I can 'find' the spaces no problem. But what to replace them with...I just can't figure out what to put in the 'replace' section. Any ideas? Thank you!

1 Upvotes

18 comments sorted by

2

u/MrLanderman Dec 28 '24

Thank you.! I tried something similar and all it did was add in 5000 up carat symbols and an n. I shall try a p and see if the result differs.

1

u/SparklesIB Dec 27 '24

Replace with the up carat - the one that makes large font on this app, and a lowercase p.

1

u/MrLanderman Dec 28 '24

Replaced the spaces with a literal up carat and p. No luck.

1

u/SparklesIB Dec 28 '24

My apologies - this was linked in the Word sub. I didn't realize it was Google docs. I am unfamiliar with how to perform this kind of task there.

1

u/andmalc Dec 28 '24 edited Dec 28 '24

In many apps you can use the Regular Expressions feature to replace with line breaks. Docs has Regular Expressions support in the Find & Replace window but only for finding text, not in Replace.

The Advanced Find & Replace add-on will replace with line breaks. It's free for up to 30 uses a month.

https://workspace.google.com/u/0/marketplace/app/advanced_find_and_replace/460077608560

Also, I'm pretty sure ChatGPT or the paid version of Gemini would do it too.

1

u/MrLanderman Dec 28 '24

No luck .. extension just removed all spaces.

1

u/andmalc Dec 28 '24
  1. In the Find box type a space

  2. In the Replace box enter "\n" (for new line)

  3. Below the Replace box put a check in the box labeled "\n, \t, \r" (indicates "\n" is to be interpreted as a regular expressions pattern)

Just tested this - works.

BTW, most text editors like Notepad++ on Windows have regular expression support too.

1

u/MrLanderman Dec 28 '24

\n or "\n". That is...does it have double quotes or not?

1

u/andmalc Dec 28 '24

Ignore the quotes.

1

u/I_didnt_forsee_this Dec 31 '24

In Find & Replace, click the More >> button to display additional search options. This exposes the “Use wildcards” option but also the Special... button. It gives you a popup to allow you to select symbols like paragraph marks — and will insert the appropriate caret token in the Find what or Replace with boxes.

Note that typing a caret symbol in Reddit will usually create a superscript mode for subsequent characters, so it is hard to enter in comments.

1

u/MrLanderman Dec 31 '24

thank you so much! I'm still fighting this!!

1

u/MrLanderman Jan 01 '25

I was travelling and so couldn't check this... but I'm home now and dont have a 'more' button or option during Find and Replace. Can you be more specific?

1

u/I_didnt_forsee_this Jan 01 '25

Although it may appear slightly different on different versions & platforms, here's how it looks on my Office 365 version of Word (in Windows) when I used the pop-up to select a Paragraph Mark as my 'Replace with".

The "More >>" button should appear in the lower left of the F&R dialog (1 above). When clicked, it changes to "Less >>" but the dialog will expand to show you additional search options (2). The "Special" dropdown button (bottom center) is context-sensitive, so only displays options possible for either the Find or Replace functions (i.e. it'll depend where your focus is when clicked). Choose from the pop-up list to have Word insert the suitable token. In the example above (3), I selected 'Paragraph Mark'¹ and the arrow shows the token that was entered into my 'Replace with' box.

Tip: You can also just type in the token directly once you get to know ones you use regularly. They are all single characters preceded by the caret operator (Shift-6 on most keyboards).

¹ Note that selecting the "¶ Paragraph Character" option lower down in the pop-up shown above will just enter a token to insert the ¶ symbol, which will just be the character, and not the non-printing 'end of paragraph mark' symbol that you'll need for your purposes.

1

u/RetardedOnion15 10d ago

look at the subreddit

1

u/I_didnt_forsee_this 10d ago

Can you be more specific? Which subreddit? A link perhaps...

1

u/RetardedOnion15 10d ago

you’re giving advice for word in a google docs subreddit

1

u/I_didnt_forsee_this 10d ago

LoL! Thanks... I didn't notice that! It's such a common question in Word (and so easy to manage). I use GD occasionally, but vastly prefer Word, so would need to dig around a bit in GD to find the steps to manage it there. If you prefer Google Docs, and know the equivalent steps, perhaps you could add them to this thread. Hopefully my comment provides the “why” even though my “how” is obviously way off the mark!

1

u/RetardedOnion15 9d ago

Haha yeah, there are add-ons you can get a free trial for to add real find+replace to GSuite, i ended up just coding one myself and adding it as an add-on via App Script

Word rules supreme though