Subject: Re: convert ###[:alpha;] to ###\n[:alpha;] ?
On 22.10.2016 14:15, Bit Twister wrote:> I want to add a new line character
between a variable length string of
> ## and text in a log file.
>
> Three short example strings:
> ####warning
> ####Error
> ####Fail
>
> My sed attempts seem to upchuck on the # character.
Impossible to tell what's wrong without seeing your sed command.
> I would like to use
> sed or awk rather than a higher level app like perl or python if possible.
Try whether your sed version works for you with
sed 's/\(###\)\([[:alpha:]]\)/\1\n\2/'
(Assuming you don't want a literal "\n" but a newline character, otherwise
prepend a '\' to '\n'.)
Janis