This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi, i'd been searching everywhere for this sort of question to get an idea about how to resolve it, found a couple but is not quite what i need (Here and Here).
i have this .csv file
getting something like this
and im trying to convert this into a tree to insert it into the DB, the object is something like this:
any ideas about what can do about it? any help would be apreciated, been going at it for 2 days with all sort of uncomplete solutions,
What freedom do you have on how the tree is stored in the database? If none at all then what format is expected by the database but if you are free to do anything then why not just store the CSV text in a BLOB or CLOB ?
Paul Monique wrote:any ideas about what can do about it? any help would be apreciated, been going at it for 2 days with all sort of uncomplete solutions,
Well, the first thing to me would seem to be to construct a tree. It would appear to be an N-tree, so why not start out with something like aand work from there? You'll probably want something like an addBranch() method and something for finding specific Nodes given a path. And once you've got the structure, you should be in a better position to deal with the database.
Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Joined: Jul 16, 2010
Thanks for both replies!! i figure it out with the help of a coworker, here is the pseudocode