Index: /GSEXmlParser/GSEXmlParser.cpp
===================================================================
--- /GSEXmlParser/GSEXmlParser.cpp	(revision 28)
+++ /GSEXmlParser/GSEXmlParser.cpp	(revision 29)
@@ -24,4 +24,17 @@
                      XmlTag("Descriptions") (descs) 
                  );
+}
+
+String Data::ToTSV()
+{
+	String tsv, tab, nl;
+	tab = "\t";
+	nl = "\n";
+	tsv = source + tab + "Sample-iid" + tab + iid + nl +
+	      source + tab + "Supplementary-Data:" + supp_type + tab + supp_data + nl;
+	for(int i = 0; i < desc.GetCount(); i++)      
+	    tsv += source + tab + "Description:" + desc.GetKey(i) + tab + desc[i] + nl; 
+	      
+	return tsv;
 }
 
@@ -91,4 +104,15 @@
 }
 
+String   GSEParser::ToTSV()
+{
+	String tsv, tab; 
+	tab = "\t";
+	tsv = "# rowkey" + tab + "columnkey" + tab + "value\n";
+	for (int i = 0; i < data.GetCount(); i++) {
+		tsv << data[i].ToTSV();
+	}
+	return tsv;
+}
+
 String TrimSpace(String str) {
 	while (str.StartsWith(" ") && str.GetLength()) {
@@ -103,24 +127,42 @@
 CONSOLE_APP_MAIN
 {
-	String in, out, arg_flag;
+	String in, out, fmt, arg_flag;
+	/*
 	in = "GSE2109_family.xml";
-	out = "GSEFamily.xml";
-	
+	out = "GSEFamily.tsv";
+	fmt = "tsv";
+	*/
 	const Vector<String>& cmdline = CommandLine();
+		
 	for(int i = 0; i < cmdline.GetCount(); i++) {
 		if (cmdline[i].StartsWith("-")){
 			arg_flag = cmdline[i];			
 		} else if (arg_flag.IsEqual("-i")) {
-			in = cmdline[i];
-			//Cout() << "in: " << in << "\n";
+			in = cmdline[i];		
 		} else if (arg_flag.IsEqual("-o")) {
-			out = cmdline[i];
-			//Cout() << "out: " << out << "\n";
+			out = cmdline[i];			
+		} else if (arg_flag.IsEqual("-f")) {
+			fmt = cmdline[i];
+		} else if (arg_flag.StartsWith("-")) {
+			//Error argument
+			Cout() << "Usage Error: invalid argument "<< arg_flag << "\n";
+			exit(0);
 		}
+	}
+	
+	if (cmdline.GetCount()==0 || in.IsEmpty() || out.IsEmpty() || fmt.IsEmpty()) {
+		Cout() << "Usage: GSEXmlParser.exe -f (xml|tsv) -i (input file) -o (output file)\n";
+		exit(0);	
 	}
 	
 	GSEParser parser;
 	parser.LoadXML(in);
-	SaveFile(out,parser.ToXML());
+	if (fmt.IsEqual("xml"))
+		SaveFile(out,parser.ToXML());
+	else if (fmt.IsEqual("tsv"))	{
+		SaveFile(out,parser.ToTSV());
+	}
+	
+	
 	
 }
Index: /GSEXmlParser/GSEXmlParser.h
===================================================================
--- /GSEXmlParser/GSEXmlParser.h	(revision 28)
+++ /GSEXmlParser/GSEXmlParser.h	(revision 29)
@@ -17,5 +17,6 @@
     String                    supp_data; //Supplementary-Data
     void   Dump();
-    String   ToXML();	    
+    String   ToXML();
+    String   ToTSV();	    
 };
 
@@ -24,4 +25,5 @@
 	void     Dump();
     String   ToXML();
+    String   ToTSV();
     void     LoadXML(String filename);	
 };
Index: /GSEXmlParser/GSEXmlParser.upp
===================================================================
--- /GSEXmlParser/GSEXmlParser.upp	(revision 28)
+++ /GSEXmlParser/GSEXmlParser.upp	(revision 29)
@@ -1,2 +1,4 @@
+optimize_speed;
+
 uses
 	Core;
Index: /GSEXmlParser/init
===================================================================
--- /GSEXmlParser/init	(revision 29)
+++ /GSEXmlParser/init	(revision 29)
@@ -0,0 +1,4 @@
+#ifndef _GSEXmlParser_icpp_init_stub
+#define _GSEXmlParser_icpp_init_stub
+#include "Core/init"
+#endif
