Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    Regarding "awk and sed don't really handle unicode characters properly" - could you provide an example where GNU awk doesn't handle Unicode properly? It may be worth raising a bug report if that is the case, idk. Commented Aug 13 at 10:24
  • This has some great thoughts, but the extra spaces in the middle are important. I don't know if that's what you mean by leading and trailing spaces. As I have the files on my machine, I don't have leading and trailing spaces. I'm going to try the solution on my files, though. Commented Aug 18 at 14:46
  • @bballdave025 Leading spaces are any spaces before the first non-space character on a line. Trailing spaces are any spaces after the last non-space character. Commented Aug 18 at 14:57
  • your comment about "the extra spaces in the middle" made me look at your examples again. it seems that you could probably get away with a regex to change sequences of 10+ spaces to a newline IF the line length is > 80. I'll edit my answer and add an example of how to do that. Commented Aug 18 at 15:42
  • Okay, that will be great. I was coming here to look at your answer more closely to see what I might be missing and to ask where the leading and trailing spaces might be, but I think we've got it. Commented Aug 18 at 16:24