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*

2
  • This answer does not give the exact output required by the original question. This answer mangles the output by compressing multiple spaces and removing leading spaces, and then suggests using other programs to try to restore formatting similar to (but not identical to) the actual output required. The answer by terdon is better. Commented Apr 25, 2022 at 7:21
  • You can use GNU awk printf function and achieve any output you 'd like. Also, please have in mind that keeping the content separated from formatting is a basic principle. Commented May 1, 2022 at 12:24