Index: /trunk/grails-app/controllers/AssetDetailedController.groovy
===================================================================
--- /trunk/grails-app/controllers/AssetDetailedController.groovy	(revision 301)
+++ /trunk/grails-app/controllers/AssetDetailedController.groovy	(revision 302)
@@ -44,4 +44,11 @@
         response.setHeader("Content-disposition", "attachment; filename=AssetTreeTemplate.csv")
         def s = csvService.buildAssetTreeTemplate()
+        render s
+    }
+
+    def exportAssetTreeTest = {
+        response.contentType = ConfigurationHolder.config.grails.mime.types["csv"]
+        response.setHeader("Content-disposition", "attachment; filename=AssetTreeTestFile.csv")
+        def s = csvService.buildAssetTreeTest()
         render s
     }
Index: /trunk/grails-app/services/CsvService.groovy
===================================================================
--- /trunk/grails-app/services/CsvService.groovy	(revision 301)
+++ /trunk/grails-app/services/CsvService.groovy	(revision 302)
@@ -111,4 +111,18 @@
 
                 if(!nextColumn()) {
+                    nextLine()
+                    continue
+                }
+
+                // Ignore comment lines.
+                if( column.name.startsWith("Comment") ) {
+                    log.info "Comment line found."
+                    nextLine()
+                    continue
+                }
+
+                // Ignore example lines.
+                if( column.name.startsWith("Example") ) {
+                    log.info "Example line found."
                     nextLine()
                     continue
@@ -223,4 +237,5 @@
 
             // Success.
+            log.info "End of file."
             reader.close()
             return result
@@ -239,8 +254,59 @@
         CSVWriter writer = new CSVWriter(sw)
 
+        writeTemplateLines(writer)
+
+        writer.close()
+        return sw.toString()
+    }
+
+    private writeTemplateLines(writer) {
         writer.writeNext(templateHeaderLine1 as String[])
         writer.writeNext(templateHeaderLine2 as String[])
         writer.writeNext()
-        writer.writeNext("Note: the header lines are required, start by replacing this line.")
+        writer.writeNext(["Example: Site1", "", "Department 1", "", "Section 1", "", "Asset 1", ""] as String[])
+        writer.writeNext()
+        writer.writeNext(["Example: Site1", "", "Department 1", "", "Section 1", "", "Asset 2", ""] as String[])
+        writer.writeNext()
+        writer.writeNext("Comment: the first two header lines are required.")
+        writer.writeNext("Comment: leave a blank line between assets.")
+        writer.writeNext("Comment: names are required, descriptions are optional.")
+        writer.writeNext("Comment: identical names in each column will be considered as the same item.")
+        writer.writeNext("Comment: any line starting with 'Comment' will be ignored.")
+        writer.writeNext("Comment: any line starting with 'Example' will be ignored.")
+        writer.writeNext("Comment: example and comment lines may be deleted.")
+        writer.writeNext()
+    }
+
+    /**
+    * Build an asset tree test file.
+    * This test file can be imported to test the import and template methods.
+    * @returns The test file as a String in csv format.
+    */
+    def buildAssetTreeTest() {
+
+        StringWriter sw = new StringWriter()
+        CSVWriter writer = new CSVWriter(sw)
+
+        writeTemplateLines(writer)
+
+        writer.writeNext(["Lake Press", "Lake Press Site",
+                                        "Print Department", "The printing department",
+                                        "Press Section", "Contains all printing units",
+                                        "Print Unit 1", "Printing Unit Number 1",
+                                        "Print Unit", "Print Unit (Common to all units)",
+                                        "Print Couple", "Includes  blanket cylinder",
+                                        "Motor", "Main Drive Motor",
+                                        "NDS Bearing", "Non Drive Side Main Bearing"
+                                        ] as String[])
+
+        writer.writeNext(["Lake Press", "Lake Press Site",
+                                        "Print Department", "The printing department",
+                                        "Press Section", "Contains all printing units",
+                                        "Print Unit 1", "Printing Unit Number 1",
+                                        "Print Unit", "Print Unit (Common to all units)",
+                                        "Print Couple", "Includes  blanket cylinder",
+                                        "Motor", "Main Drive Motor",
+                                        "DS Bearing", "Drive Side Main Bearing"
+                                        ] as String[])
 
         writer.close()
@@ -259,6 +325,6 @@
 
         //Header
-        def header = ["Site", "Section", "Asset", "Sub Asset", "Functional Assembly", "Sub Assembly Group"]
-        writer.writeNext(header as String[])
+        writer.writeNext(templateHeaderLine1 as String[])
+        writer.writeNext(templateHeaderLine2 as String[])
 
         //Rows
