Split a single Alternative Data Stream into three parts and populate each part into its own custom column?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Jose-Santiago3333
Posts: 10
Joined: Sat Aug 13, 2022 8:19 pm

Split a single Alternative Data Stream into three parts and populate each part into its own custom column?

Post by Jose-Santiago3333 »

I have been searching the forum for a way to do this and have not found anything that is concrete.
I will first explain what I have in mind then please if you can tell me if its currently possible to do such a thing in Everything. That would help me allot.
___
I use the excellent file manager Directory Opus instead of the default "Explorer" Tool. In it I have three "user defined" custom Columns.
the Columns are called
Category
,
Flags
and
Notes
. It looks like this:
Image

The data that is populated in these columns comes from a single NTFS Alternative Data Stream called
MultiTags.txt
, in the example above, each files streams content is:

Code: Select all

Tag001: Notes Metadata  
Tag002: Flags MetaData  
Tag000: Category Metadata
In Directory Opus, using Regular Expression I am able to split the NTFS Alternative Data Stream into three parts and populate each part into its own custom column (I think, I did not write this custom script).

Now in Everything I am able to find the NTFS Alternative Data Stream called
MultiTags.txt
under the Column
Alternate Data Stream ANSI
:
Image
This is a good start but as you can it exposes the full "Raw" string. I really need to process this NTFS stream string with RegEx (or another means that Everything offers) into three parts of:
  • Category MetaData
  • Flags MetaData
  • Notes MetaData
and then store each part into its own column, so that everything also looks something like this too:
Image


I have found a few threads that looked promising, for example in this one, advice about ADS voidtools forum. User fantasynew was asking about Custom columns per NTFS ADS stream, they reported the solution offered worked just fine but they were dealing with Multiple data streams.
In here, Ability to Search Tags voidtools forum. Void shows an example of Custom properties.

I tried to follow the example but was not successful at all.
But I ask now, this only maps a single NTFS ADS stream per custom column right? I may be wrong, please let me know.


Thanks for any help.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Split a single Alternative Data Stream into three parts and populate each part into its own custom column?

Post by raccoon »

I would also like to split sidecar files into custom columns, whether by regex captures or native support for yaml, json, xml, csv/tsv/ssv data structures.
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: Split a single Alternative Data Stream into three parts and populate each part into its own custom column?

Post by void »

You could capture each line from alternate-data-stream-ansi and use the regmatch1..regmatch3 columns with the following search:

regex:alternate-data-stream-ansi:(.*)\n(.*)\n(.*) addcolumn:regmatch1,regmatch2,regmatch3

Consider adding this as a filter under Search -> Add to filters...


I have put on my TODO list to add custom columns for yaml, json, xml, csv, tsv, etc.. from alternate data streams.
Thanks for the suggestion.
Jose-Santiago3333
Posts: 10
Joined: Sat Aug 13, 2022 8:19 pm

Re: Split a single Alternative Data Stream into three parts and populate each part into its own custom column?

Post by Jose-Santiago3333 »

This is great!
with your help and some more reading around the forum I was able to figure it out.

I will document what I did just in case it may help someone else.
Place the Multitags stream content into its own column:
/property_alternate_data_stream_ansi=Custom Property 0=MultiTags.txt
Correctly rename the custom_property_0 column to a chosen name:
/custom_property_0=MultiTag raw
Then using RegEx, target the content of custom_property_0 with regex:, the results of capture groups are pushed to regmatch7, regmatch8 and regmatch9
this way RegMatch 0-6 are still free to use? (I dont know)
regex:custom_property_0:()()()()()()tag000:.(.)\ntag001:.(.)\ntag002:.(.*)
Rename the Regex columns via localization strings.

Its a little bit dirty but I am so happy to be finally free from the awful way windows writes metadata to files inconsistently.
I have put on my TODO list to add custom columns for yaml, json, xml, csv, tsv, etc.. from alternate data streams.
I am glad that you have considered side loading xml, json and csv files. This is something that I really look forward to having in Everything. Thanks allot!
void
Developer
Posts: 16672
Joined: Fri Oct 16, 2009 11:31 pm

Re: Split a single Alternative Data Stream into three parts and populate each part into its own custom column?

Post by void »

this way RegMatch 0-6 are still free to use? (I dont know)
To clarify:
no, regmatch 0-6 will always be blank.

If you use another regex search, it will overwrite your older one.
(regex searches are performed from left to right)
Post Reply