PDA

View Full Version : Importing hierarchical information from a csv file


kevina
04-03-2007, 02:37 PM
You can import hierarchical records (parent - child relationships) into Ultra Recall from a CSV file, if you use import a CSV Indent Level "column" into the virtual Indent Level attribute when importing.

Let's assume you have some hierarchical records in some application that looks like this:
LastName, FirstName, Company
"","","Acme Corp"
+ "Doe","John",""
+ "Smith", "David", ""
"","","Widgit Inc."
+ "","Doe","Jane"

Where the + symbolizes that this record is a child of the preceding record.

You would export the data to a csv file like this:
"LastName","FirstName","Company","IndentLevel"
"","","Acme Corp",0
"Doe","John","",1
"Smith","David","",1
"","","Widgit Inc.",0
"Doe","Jane","",1

Note: an IndentLevel value of 0 indicates no indent - the order of the records in the csv file is critical to defining the relationships between the records (when a record has a non-zero indentlevel value, it will become a child of the last preceding record with an indentlevel value one less than the record's value).