Timeline for How can I use quantifiers in a sed substitution expression (indenting text)?
Current License: CC BY-SA 4.0
21 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 13, 2024 at 15:22 | answer | added | canupseq | timeline score: 0 | |
| Jan 12, 2024 at 19:37 | history | edited | jubilatious1 | CC BY-SA 4.0 | add "indenting text" to title |
| Jun 8, 2022 at 8:04 | answer | added | Clement | timeline score: 0 | |
| Sep 15, 2021 at 0:15 | answer | added | jubilatious1 | timeline score: 2 | |
| Jul 23, 2021 at 13:17 | answer | added | Stéphane Chazelas | timeline score: 2 | |
| S Jul 22, 2021 at 10:36 | history | suggested | Peter Mortensen | CC BY-SA 4.0 | Copy edited (e.g. ref. <https://english.stackexchange.com/questions/4645/is-it-ever-correct-to-have-a-space-before-a-question-or-exclamation-mark#comment206109_4645> and <https://en.wikipedia.org/wiki/Sentence_clause_structure#Run-on_sentences>). |
| Jul 22, 2021 at 10:01 | review | Suggested edits | |||
| S Jul 22, 2021 at 10:36 | |||||
| S Jul 17, 2021 at 17:16 | vote | accept | ChennyStar | ||
| Jul 16, 2021 at 8:50 | history | edited | ChennyStar | CC BY-SA 4.0 | deleted 2 characters in body |
| Jul 15, 2021 at 17:14 | history | became hot network question | |||
| Jul 15, 2021 at 16:13 | answer | added | ChennyStar | timeline score: 12 | |
| Jul 15, 2021 at 14:39 | comment | added | steeldriver | For this particular case, you could insert a single tab character, then "multiply" it to a desired number of space characters using the expand command: echo 'something' | sed 's/^/\t/' | expand -it 10 | |
| Jul 15, 2021 at 12:24 | answer | added | Boyd | timeline score: 11 | |
| Jul 15, 2021 at 10:46 | history | edited | muru | edited tags | |
| Jul 15, 2021 at 10:31 | comment | added | ibuprofen | Yeah printf in general is a powerful tool for formatting. Have a look into it if not familiar with it. It differs some between implementations, i.e. shells, coreutils, c, awk, perl, ... but basics are the same. E.g. also: awk -v width=10 '{printf "%*s%s\n", width, "", $0}' (using asterisk in format string to denote width is a variable). | |
| Jul 15, 2021 at 10:11 | answer | added | nezabudka | timeline score: 11 | |
| Jul 15, 2021 at 10:10 | vote | accept | ChennyStar | ||
| S Jul 17, 2021 at 17:16 | |||||
| Jul 15, 2021 at 10:04 | comment | added | ChennyStar | @ibuprofen : that's a great and short solution, I usually don't think at awk when I think "string replacement", but it seems awk can sometimes be more convenient than sed. Thanks | |
| Jul 15, 2021 at 9:51 | comment | added | ibuprofen | You could use awk instead ... | awk '{printf "%10s%s\n", "", $0}'. Know you are asking for sed, so only a comment. | |
| Jul 15, 2021 at 9:42 | answer | added | schrodingerscatcuriosity | timeline score: 12 | |
| Jul 15, 2021 at 9:12 | history | asked | ChennyStar | CC BY-SA 4.0 |