Some attempts that failed: `addcolumn:a a:=($size:>1GB)`, `addcolumn:a a:=($size: >1000000000)`, `addcolumn:a a:=($size:)>1GB`;
The coloring part should be much easier. I just plan on using: `dupe:something_goes_here groupcolors:`;
How do I add a column with whether a file is bigger than 1GB? (Through which I will color files bigger than 1GB)
-
- Posts: 7
- Joined: Thu Aug 01, 2024 10:03 pm
Re: How do I add a column with whether a file is bigger than 1GB? (Through which I will color files bigger than 1GB)
There are probably other ways, but the following seems the simplest (in my mind):
or if you don't care about the "0" in the A-column when size <= 1GB:
Explanation:
<> : groups partial searches.
| : OR
searchpart1 | searchpart2 : If searchpart1 matches, there is no more need to searchpart2
searchpart1 = size:>1GB A:=1 : If file/folder size > 1GB, A will be set to 1
searchpart2 = A:=0 : For all files/folders where size <= 1GB, searchpart2 will be "executed". It will set column A to 0 (or empty, in the second example)
If you are just interested in files (so not folders), add file: to your search:
Code: Select all
addcolumn:A < size:>1GB A:=1 > | A:=0
Code: Select all
addcolumn:A < size:>1GB A:=1 > |
<> : groups partial searches.
| : OR
searchpart1 | searchpart2 : If searchpart1 matches, there is no more need to searchpart2
searchpart1 = size:>1GB A:=1 : If file/folder size > 1GB, A will be set to 1
searchpart2 = A:=0 : For all files/folders where size <= 1GB, searchpart2 will be "executed". It will set column A to 0 (or empty, in the second example)
If you are just interested in files (so not folders), add file: to your search:
Code: Select all
file: addcolumn:A < size:>1GB A:=1 > | A:=0
-
- Posts: 7
- Joined: Thu Aug 01, 2024 10:03 pm
Re: How do I add a column with whether a file is bigger than 1GB? (Through which I will color files bigger than 1GB)
That does exactly what I wanted! Thank you! : )
But I don't know how to generalize it. Would you perhaps helping figure out how to do it for three labels? (>2GB , vs >1GB, vs neither) I tried to adapt your partial search syntax but it didn't work.
And if it's not trouble if you know how to do it using that'd be great too.
Edit:
The below worked, but alternatives are more than welcome.
The query that I initially tried is the one below. Before it failed, now it works. I'm not sure why.
But I don't know how to generalize it. Would you perhaps helping figure out how to do it for three labels? (>2GB , vs >1GB, vs neither) I tried to adapt your partial search syntax but it didn't work.
And if it's not trouble if you know how to do it using
Code: Select all
IFS(condition1,result1,condition2,result2,...)
Edit:
The below worked, but alternatives are more than welcome.
Code: Select all
< size:>2GB A:=2 > | < size:<1GB A:=0 > | A:=1
The query that I initially tried is the one below. Before it failed, now it works. I'm not sure why.
Code: Select all
< size:>2GB A:=2 > | < size:>1GB A:=1 > | A:=0
-
- Posts: 7
- Joined: Thu Aug 01, 2024 10:03 pm
Re: How do I add a column with whether a file is bigger than 1GB? (Through which I will color files bigger than 1GB)
Query - Color by size category ( >2GB vs 1GB> vs else)
Here is my current query to highlight files per their "size" category. But it's buggy, if I try to sort by anything other than column A it fails.
Here is my current query to highlight files per their "size" category. But it's buggy, if I try to sort by anything other than column A it fails.
Code: Select all
addcolumn:A < size:>2GB A:=2 > | < size:>1GB A:=1 > | A:=0 dupe:A groupcolors:
Re: How do I add a column with whether a file is bigger than 1GB? (Through which I will color files bigger than 1GB)
TenTickles wrote: ↑Wed Dec 04, 2024 4:43 pm And if it's not trouble if you know how to do it using
IFS(condition1,result1,condition2,result2,...)
Code: Select all
addcolumn:A A:=Ifs(size:>2000000000,2,size:>1000000000,1,size:<=1000000000,0)
TenTickles wrote: ↑Wed Dec 04, 2024 5:12 pm Here is my current query to highlight files per their "size" category. But it's buggy, if I try to sort by anything other than column A it fails.
That is the right query
dupe: compares item1 with item 2 (and 2 with 3, etc). If they are the same - based on what kind of duplicates you are searching for, it will be put in the same "dupe-group".
When you change the sort (by name), that order will be messed up and duplicates matching using the above described mechanism will fail.
Solution:
Code: Select all
addcolumn:A < size:>2GB A:=2 > | < size:>1GB A:=1 > | A:=0 dupe:column-A sort:column-A-descending,name
(added descending sort for column-a, because I guess that is what you will ask next )
-
- Posts: 7
- Joined: Thu Aug 01, 2024 10:03 pm
Re: How do I add a column with whether a file is bigger than 1GB? (Through which I will color files bigger than 1GB)
Everything seems to be working and the explanations really help. Thank you so much!