Doing some folder path reconciliation on a NAS drive via Ignition. I wanted to first scan all the folders to see where everything was at so I could display them in a tree view in a Vision window. Here’s a sample of how the data is stored -
I just used
os.walk and saved each folder to the fullPath column of my table
Here’s my attempt at the SQL query for the Items of the tree
SELECT REPLACE(fullPath,SUBSTRING_INDEX(fullPath, '\\', -1),'') as 'path',REPLACE(fullPath,'\\','//') as 'fullPath', fullPath as 'text' FROM pathreconciliation WHERE depth <= 3 ORDER BY fullPath
and here is what I am seeing -
It is almost there but as you can see children are duplicated to be their own parent item as well and I am not sure how to fix this.
Any ideas how to fix this? I can edit the table if need be, I have full control over it if there’s way to manipulate this data into multiple columns if that helps somehow.