Fohls Fohls - 9 months ago 65
Javascript Question

Create navigable tree from csv of path names

we are struggling with a large migration project currently and are on the last leg of putting together the user interface.

I have a list of effectively folder paths from the old system like so:

/Programme2/ Project2/WorkPackage1/Finance

Currently these are in a csv, we need to be able to create a navigable object that a user can use to navigate through to find relevant documentation.

enter image description here

We have a number of issues:

  1. There are 114000+ rows in the csv

  2. We know the max number of subfolders and it's large (too many to code manually!).

  3. There are special characters in the list, including umlauts, french accented chars + greek alphabet chars...

  4. A fair number (2000+) rows of the list are longer than 400 characters..

  5. We're limited also to what tools we can use. We've been playing with json/jquery/jstree/javascript/excel-vba and have had some success, but its been painful.

If anyone out there has had a similar challenge and any success I'd be interested in finding out how you went about it!

Thanks for looking.


Answer Source

If I were you I'd transform the flat paths from the csv into a tree structure and store it in a database. This is essentially the information you have but without the redundancy in the csv. From there it's pretty straight forward transform it to a presentation form. Jstree is one good option. Shouldn't take long to get that up and running.