From: Michelle Col Date: 2012-09-07T04:46:15+09:00 Subject: read in hierarchy file then export in comma delimited format. Hi. I am a beginner to ruby programming. I would like to create a program that reads in a hierarchy file having table, column and data. The file would be read and exported into a text file delimited by commas. I have pasted an example of the file that would be read in. Thanks in advance. Michelle To explain, the indents: When 0 indents then the record is a Table, when 3 indents then a Column, when 6 indents then a Value. The text file should be comma delimited by table, column and value. Example row data that I would like the new text file to look like: TABLE, COLUMN, VALUE DOC, BEGIN_OR_END, BEGIN DOC, BEGIN_OR_END, END DOC, PROPOSED OR EXISTING, PROPOSED This is the file contents and layout of the current file: "DOC", point, "DEPTH OF COVER", 5, seconds, 1, Code "BEGIN_OR_END", menu, normal, "BEGIN_OR_END", normal "BEGIN" "END" "PROPOSED OR EXISTING", menu, normal, "PROPOSED OR EXISTING", normal "PROPOSED" "EXISTING" "COVER", numeric, 0, 0, 10000, 0, normal, "COVER", normal "COMMENTS", text, 30, normal, "COMMENTS", normal "EROSION_CONTROL", point, "EROSION CONTROL", 5, seconds, 1, Code "IS THIS ON THE CL?", menu, required, "IS THIS ON THE CL?", required "YES" "NO" "BEGIN_OR_END", menu, normal, "BEGIN_OR_END", normal "BEGIN" "END" "TYPE", menu, required, "TYPE", normal "BREAKER" "CLAY" "DIRT" "FOAM" "MATERIAL", menu, normal, "MATERIAL", normal "RIPRAP" "SACKCRETE" "SAND BAG" "TERRACE" "UNKNOWN" "COMMENTS", text, 30, normal, "COMMENTS", normal -- Posted via http://www.ruby-forum.com/.