Search for text in table column by clicking on the column name #4618
-
|
I have spend at least 3 hours today reading the changelogs as well as the man page to see if I can get it to work but I am stumped, so here we go. I want to recreate the example from https://junegunn.github.io/fzf/releases/0.59.0/#click-header-enhancements where I have tabular input and be able to click on each column and be able to search for strings within this column. I have JSON which looks like this: [
{
"certname": "node1.contoso.com",
"title": "Role::Db::Oracle"
},
{
"certname": "node2.contoso.com",
"title": "Role::Test"
},
{
"certname": "node3.contoso.com",
"title": "Role::Db::Oracle"
}
]I use this combination to format the output for fzf this produces the following output: I borrowed and adapted a fzf command like so: The complete command to try out looks like this: now while this produces output I can filter, it starts to break when I click on any of the column names to filter for the text within this column. Can someone give me some pointers what I am doing wrong? Additionally: I've read over and over things like "-nth". What does "-nth" even mean. For example I use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
|
I haven't looked closely enough but given that there are multiple consecutive spaces in the input, # Without --delimiter, fzf splits input into fields in awk-style.
echo '1st 2nd 3rd' | fzf --nth 2 --query 2
# No match.
# With a single space character as the delimiter, consecutive spaces are now recognized as a series of empty fields,
# --nth 2 points to one of the empty fields
echo '1st 2nd 3rd' | fzf --nth 2 --query 2 --delimiter ' 'Try removing it from your commands. If you really must use echo '1st 2nd 3rd' | fzf --nth 2 --query 2 --delimiter ' +'But I don't recommend it in this case, as it's unnecessary and it only makes the processing slower. |
Beta Was this translation helpful? Give feedback.
Okay, I see what's happening. Try this one, and you'll see it works as expected:
In your command, by using
transform-header, you're effectively prepending a number to the header section. It starts with:But when you click
Name, it…