lizmat / App-Rak

21st century grep / find / ack / ag / rg on steroids
Artistic License 2.0
153 stars 7 forks source link

Multiline replace #56

Closed greenfork closed 2 months ago

greenfork commented 2 months ago

Thank you for this awesome binary!

I have a use case to perform multiline replacements in code, here is an example. For this file text.txt:

Multi

line

I can do matching with rak --per-file '/Multi\n\nline/' text.txt but I can't also specify the --modify-files option because it complains:

Can only have one action at a time: '--modify-files' was specified before '--per-file'

Are there any hard-blockers to implement multiline replacement or someone just needs to implement it?

lizmat commented 2 months ago

Thanks for he report!

I'll see I can get this into the next release. On which I will be working after getting this week's Rakudo Weekly News out of the door today :-)

lizmat commented 2 months ago

Meh, looks like this needs a re-think of the way --per-line and --per-file work. So I doubt a fix for this will be seen today. Sorry.

greenfork commented 2 months ago

Sure, thank for looking into it! My problem is solved by manual labor :( no rush for me right now :^)

lizmat commented 2 months ago

Release 0.3.5 fixes this issue.

Thanks again for reporting!