Hello all,
I am new to Textmate and looking for a way to filter lines as I did with the old editor "kedit". It had commands like "all /blabla" to display only lines containing "blabla", "more /yesyes" to add the lines containing "yesyes" to the current line view, and "less /blabla" to hide again the lines containing "blabla" from the current view.
I will be happy to get just the "all /blabla" functionality in Textmate, i.e. I'd like to filter out all lines containing (for example) "<onetwothree>" and either hide all the others or export all the "<onetwothree>" lines to another file.
Is there a way to achieve that???
Thanks
Visconti
-- View this message in context: http://textmate.1073791.n5.nabble.com/Filtering-out-specific-lines-tp26423.h... Sent from the textmate users mailing list archive at Nabble.com.
Hi Visconti,
To get something equivalent to "all /blabla": In latest Textmate build, cmd-| ("|" is unix pipe character, not lowercase l or uppercase i) triggers "Filter through command". First select all text you want to search inside. Then press cmd-| You can then type "grep 'blabla'" as command. You can select how output will be handled.
Grep can do way more of course. For example, "grep 'foo|bar'" will output lines containing either foo or bar. You can also exclude words. See http://stackoverflow.com/questions/4538253/grep-how-could-i-exclude-one-word for how.
I don't think there's a way to exclude/include lines interactively, but you can get pretty far by just editing the grep command, and rerunning it either on current result, or on the original text.
Allan, there seems to be a bug (or is it a feature?) where if command output is null, the selected text is not replaced.
Meryn
On Mon, Mar 25, 2013 at 10:05 PM, Visconti visconticc@yahoo.com wrote:
Hello all,
I am new to Textmate and looking for a way to filter lines as I did with the old editor "kedit". It had commands like "all /blabla" to display only lines containing "blabla", "more /yesyes" to add the lines containing "yesyes" to the current line view, and "less /blabla" to hide again the lines containing "blabla" from the current view.
I will be happy to get just the "all /blabla" functionality in Textmate, i.e. I'd like to filter out all lines containing (for example) "<onetwothree>" and either hide all the others or export all the "<onetwothree>" lines to another file.
Is there a way to achieve that???
Thanks
Visconti
-- View this message in context: http://textmate.1073791.n5.nabble.com/Filtering-out-specific-lines-tp26423.h... Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 25 Mar 2013, at 23:50, Meryn Stol wrote:
Allan, there seems to be a bug (or is it a feature?) where if command output is null, the selected text is not replaced.
If the output is empty _and_ there is output sent to stderr, then it shows the stderr output as a tool tip and doesn’t replace input.
I tried with ‘printf ""’ but that did replace input (with empty string).
If the output is empty _and_ there is output sent to stderr, then it shows the stderr output as a tool tip and doesn’t replace input.
I tried with ‘printf ""’ but that did replace input (with empty string).
Indeed, you're right. It turns out to be an issue with grep. It's not that it there's is output on stderr, but its exit code is actually 1 if it does not match any lines. "Normally, exit status is 0 if selected lines are found and 1 otherwise. But the exit status is 2 if an error occurred, unless the -q or --quiet or --silent option is used and a selected line is found." That's an unexpected feature for me. :)
Maybe you could add a tooltip saying "command failed (without any output)" or so?
-- Meryn
On 26 Mar 2013, at 12:30, Meryn Stol wrote:
Maybe you could add a tooltip saying "command failed (without any output)" or so?
I have changed this for next build so there should always be feedback.
https://github.com/textmate/textmate/commit/7b115dc21214bffc0ff515baa65d9102...
Great!
On Tue, Mar 26, 2013 at 2:08 PM, Allan Odgaard mailinglist@textmate.orgwrote:
On 26 Mar 2013, at 12:30, Meryn Stol wrote:
Maybe you could add a tooltip saying "command failed (without any output)"
or so?
I have changed this for next build so there should always be feedback.
https://github.com/textmate/**textmate/commit/** 7b115dc21214bffc0ff515baa65d91**02ca99b3a0https://github.com/textmate/textmate/commit/7b115dc21214bffc0ff515baa65d9102ca99b3a0
______________________________**_________________ textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/**listinfo/textmatehttp://lists.macromates.com/listinfo/textmate
Perhaps even better for your purposes: Try bundles -> text -> filtering. I think it uses grep as well.
On Mon, Mar 25, 2013 at 10:05 PM, Visconti visconticc@yahoo.com wrote:
Hello all,
I am new to Textmate and looking for a way to filter lines as I did with the old editor "kedit". It had commands like "all /blabla" to display only lines containing "blabla", "more /yesyes" to add the lines containing "yesyes" to the current line view, and "less /blabla" to hide again the lines containing "blabla" from the current view.
I will be happy to get just the "all /blabla" functionality in Textmate, i.e. I'd like to filter out all lines containing (for example) "<onetwothree>" and either hide all the others or export all the "<onetwothree>" lines to another file.
Is there a way to achieve that???
Thanks
Visconti
-- View this message in context: http://textmate.1073791.n5.nabble.com/Filtering-out-specific-lines-tp26423.h... Sent from the textmate users mailing list archive at Nabble.com.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate