[seqfan] Re: sed command to convert leading spaces to dots in Python/Sage programs

Bob Lyons boblyonsnj at gmail.com
Sat Mar 12 14:43:23 CET 2016


And the following sed command will convert the leading dots back into
spaces:

  sed -e ':again' -e 's/^\(\.*\)[.]\([^.]\)/\1 \2/; t again'
program_with_leading_dots.py

Bob


On Fri, Mar 11, 2016 at 11:57 PM, Bob Lyons <boblyonsnj at gmail.com> wrote:

> My friend Paul Staniforth wrote the following sed command, which can be
> used to convert  leading spaces into dots in Python/Sage programs:
>
>   sed -e ':again' -e 's/^\( *\)[ ]\([^ ]\)/\1.\2/; t again' program.py
>
> I've tested it on Mac, Ubuntu and Redhat.
>
> I took the liberty of adding this command to the following wiki page:
>
>
> https://oeis.org/w/index.php?title=Style_Sheet&stable=0&shownotice=1#Programs
>
> Thanks,
>
> Bob
>
>


-- 
Bob


More information about the SeqFan mailing list