HurleyShanabarger Posted January 12, 2022 Share Posted January 12, 2022 Hi there, I am using SQLite to extract data from a database with one of the tables storing a "flat" file/folder structure, containing around 10000 entries. The ParentId for the root level is kown. Due the fact the both IDs are GUIDs the data in the array is chaotic. COLUM ParentId | COLUMN ChildName | COLUMN ChildId | COLUMN Type ParentId_01 | ChildName_01 | ChildId_01 | File ParentId_01 | ChildName_02 | ChildId_02 | Folder ParentId_01 | ChildName_02 | ChildId_02 | File ... | | | ParentId_nn | ChildName_nn | ChildId_nn | Folder I want to extract/create the hierachy structure and I am looking for a good aproach. My current idea would be a recursive function Call the function with the Id for the root level loop through the array searching for the matching GUID if found and type is file, print data if found and type is folder, call function again Is there a better/possible faster approach (maybe even utilizing SQLite for this)? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now