Dec-16-2018, 08:20 AM
Skaperen Wrote:any suggestions?I think it's a very good idea. I'm thinking about the itertools module with its
dropwhile()
and takewhile()
methods and I imagine a DSL such asOutput:take until line 10
drop 3 lines
take until regex "foo(bar|qux)"
drop until "begin"
take until "end"
take 1 line
Such a "program" would generate an iterable of lines to be sent to a new file. The DSL could manage several input files at the same time...