New column displaying a part of filename

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
sk2107
Posts: 288
Joined: Sun Aug 07, 2022 8:48 pm

New column displaying a part of filename

Post by sk2107 »

Hi,

I have renamed my files regarding certain categories by having few letters in the beginning of the file ends by # and the rest of the name .
for example:
abc#aaaafffffsaaa.jpg
RRRRR#kkkffff srrrwwww ww.avi
.... etc


Now in order to have some operation like filtering, distinct, unique...etc) regarding first part before the #, I need to create a new column holding that part, as in my example column will be:
abc#
RRRRR#
.... etc



Thank you
NotNull
Posts: 5270
Joined: Wed May 24, 2017 9:22 pm

Re: New column displaying a part of filename

Post by NotNull »

If you want the Category to include the #:

Code: Select all

regex:^(.+?#)   add-column:A   A-label:=Category   A:=regmatch1: 
Without the #:

Code: Select all

regex:^(.+?)#   add-column:A   A-label:=Category   A:=regmatch1: 
sk2107
Posts: 288
Joined: Sun Aug 07, 2022 8:48 pm

Re: New column displaying a part of filename

Post by sk2107 »

Great. thank you,

Can I add another column to have the length of the result (len of A column)

Best regards
NotNull
Posts: 5270
Joined: Wed May 24, 2017 9:22 pm

Re: New column displaying a part of filename

Post by NotNull »

sk2107 wrote: Thu Apr 04, 2024 2:48 pm Can I add another column to have the length of the result (len of A column)
Nobody is stopping you ;)

Code: Select all

regex:^(.+?)#   add-column:A;B   A-label:=Category   A:=regmatch1:   B-label:=Length   B:=len($regmatch1:) 
sk2107
Posts: 288
Joined: Sun Aug 07, 2022 8:48 pm

Re: New column displaying a part of filename

Post by sk2107 »

Perfect. Thanks a lot

Best regards
Post Reply