0

I'm trying to edit a text file in Linux. I need to replace all sentences ending in a single space with double spaces. I'm not sure what I'm doing wrong, but it's not fixing all of them, just some.

sed 's/\.\s/. /g' examplefile.txt

Any nudge in the right direction? Thanks!

Maggie K
  • 31
  • 8
  • Can you see any pattern to the ones it's not fixing? Could they be going over a newline, or could it be fixing every-other-one, or something? I don't really have any guesses - but if you could copy a section of the file where it is fixing one, and is not fixing another, and edit into your question, that might help people spot what's happening. – TessellatingHeckler Aug 28 '18 at 23:47
  • [Insert space after period using sed](https://stackoverflow.com/q/10524476/608639), [Replace single whitespaces with double](https://stackoverflow.com/q/48987638/608639), [sed command to replace multiple spaces into single spaces](https://stackoverflow.com/q/22939323/608639), etc. – jww Aug 29 '18 at 00:34
  • maybe some of the empty glyphs aren't spaces? – Jasen Aug 29 '18 at 01:31

0 Answers0