Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I remove a multi-strong occurence with textfilter? #3614

Closed
zDEFz opened this issue Jan 18, 2025 · 3 comments
Closed

How do I remove a multi-strong occurence with textfilter? #3614

zDEFz opened this issue Jan 18, 2025 · 3 comments

Comments

@zDEFz
Copy link

zDEFz commented Jan 18, 2025

Following order following per line:

ICONST_1
DUP
POP2

Tried stuff like "CtrlJ": "command:textfilter sed '/ICONST_1/{N;/DUP/{N;/POP2/d;}}'" but it doesn't work.
What can I do?

@dmaluka
Copy link
Collaborator

dmaluka commented Jan 19, 2025

You probably meant "multi-string occurrence"? It took me a while to guess that.

Now, sed '/ICONST_1/{N;/DUP/{N;/POP2/d;}}' is supposed to remove any 3 consecutive lines such that the 1st line contains ICONST_1, the 2nd line contains DUP and the 3rd one contains POP2, right? So I've checked that your CtrlJ binding works for me: when I select text and press Ctrl-J, it removes all such 3 consecutive lines within the selected text, just like when I run this sed command from command line.

@zDEFz
Copy link
Author

zDEFz commented Jan 19, 2025

You probably meant "multi-string occurrence"? It took me a while to guess that.

Now, sed '/ICONST_1/{N;/DUP/{N;/POP2/d;}}' is supposed to remove any 3 consecutive lines such that the 1st line contains ICONST_1, the 2nd line contains DUP and the 3rd one contains POP2, right? So I've checked that your CtrlJ binding works for me: when I select text and press Ctrl-J, it removes all such 3 consecutive lines within the selected text, just like when I run this sed command from command line.

Interesting! I did a update and a reboot and now it works!

@matthias314
Copy link
Contributor

Can this issue be closed?

@zDEFz zDEFz closed this as completed Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants