Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 964)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 965)
@@ -26,20 +26,14 @@
 package org.txm.concordance.rcp.editors;
 
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
 import java.util.List;
 
-import org.apache.commons.lang.StringUtils;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.SafeRunner;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.e4.ui.workbench.modeling.EModelService;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
@@ -87,7 +81,6 @@
 import org.eclipse.swt.widgets.TableItem;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.IWorkbenchPartSite;
 import org.eclipse.ui.PartInitException;
 import org.txm.concordance.core.functions.Concordance;
@@ -111,7 +104,6 @@
 import org.txm.concordance.rcp.handlers.DeleteLines;
 import org.txm.concordance.rcp.messages.ConcordanceUIMessages;
 import org.txm.concordance.rcp.widgets.ComplexSortSelector;
-import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMResult;
@@ -119,31 +111,23 @@
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.JobsTimer;
 import org.txm.rcp.StatusLine;
-import org.txm.rcp.TXMWindows;
 import org.txm.rcp.editors.TXMBrowser;
 import org.txm.rcp.editors.TXMEditor;
-import org.txm.rcp.editors.TXMResultEditorInput;
 import org.txm.rcp.editors.TableKeyListener;
 import org.txm.rcp.editors.listeners.ComputeKeyListener;
 import org.txm.rcp.editors.listeners.ComputeSelectionListener;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.preferences.RCPPreferences;
 import org.txm.rcp.swt.GLComposite;
-import org.txm.rcp.swt.dialog.ViewPropertySelectionDialog;
 import org.txm.rcp.swt.widget.AssistedQueryWidget;
 import org.txm.rcp.swt.widget.NavigationWidget;
 import org.txm.rcp.swt.widget.PropertiesSelector;
-import org.txm.rcp.swt.widget.structures.PropertiesComboViewer;
 import org.txm.rcp.utils.JobHandler;
-import org.txm.rcp.utils.SWTEditorsUtils;
 import org.txm.rcp.views.QueriesView;
-import org.txm.rcp.views.corpora.CorporaView;
 import org.txm.searchengine.cqp.CQPSearchEngine;
 import org.txm.searchengine.cqp.ReferencePattern;
-import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.Property;
-import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
 import org.txm.searchengine.cqp.corpus.WordProperty;
 import org.txm.utils.logger.Log;
 
@@ -686,9 +670,7 @@
 		data3.right = new FormAttachment(100);
 		viewer.getTable().setLayoutData(data3);
 		
-		
 		createContextMenu();
-
 	}
 
 	/**
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macroproto/importer/XTZImporterMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macroproto/importer/XTZImporterMacro.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macroproto/importer/XTZImporterMacro.groovy	(revision 965)
@@ -167,7 +167,7 @@
 	println " stop if a XML source is malformed: "+stopIfMalformed
 }
 
-File allmetadatasfile = new File(srcDir, "metadata.csv");
+File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
 
 // Apply XSL
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivaLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivaLoader.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/factiva/factivaLoader.groovy	(revision 965)
@@ -128,7 +128,7 @@
 	println " stop if a XML source is malformed: "+stopIfMalformed
 }
 
-File allmetadatasfile = new File(srcDir, "metadata.csv");
+File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
 
 // Apply Factiva2XMLTXM
 println "Factiva -> xml/w"
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/importer.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/importer.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/discours/importer.groovy	(revision 965)
@@ -88,7 +88,7 @@
 		Collections.sort(filelist);
 
 		// get the headers
-		def csvfile = new File(srcDir, "metadata.csv");
+		def csvfile = Metadatas.findMetadataFile(srcDir);
 		Metadatas metadatas; // text metadata
 		
 		println "Trying to read metadata from: "+csvfile
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/docLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/docLoader.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/doc/docLoader.groovy	(revision 965)
@@ -99,7 +99,7 @@
 String paginationElement = "pb";
 boolean normalizeMetadata = true;
 
-File allmetadatasfile = new File(srcDir, "metadata.csv");
+File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
 
 if (txmDir.listFiles() == null) {
 	println "No file to process"
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/transcriberLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/transcriberLoader.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/transcriber/transcriberLoader.groovy	(revision 965)
@@ -114,7 +114,7 @@
 
 //get metadata values from CSV
 Metadatas metadatas; // text metadata
-File allmetadatasfile = new File(srcDir, "metadata.csv");
+File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
 println "Trying to read metadatas values from: "+allmetadatasfile
 if (allmetadatasfile.exists()) {
 	File copy = new File(binDir, "metadata.csv")
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xmltxm/xmltxmLoader.groovy	(revision 965)
@@ -95,7 +95,7 @@
 txmDir.deleteDir();
 txmDir.mkdirs();
 
-File allmetadatasfile = new File(srcDir, "metadata.csv");
+File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
 
 // Apply XSL
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/txtLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/txtLoader.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/txt/txtLoader.groovy	(revision 965)
@@ -88,7 +88,7 @@
 
 //get metadata values from CSV
 Metadatas metadatas; // text metadata
-File allmetadatasfile = new File(srcDir, "metadata.csv");
+File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
 
 if (allmetadatasfile.exists()) {
 	println "Trying to read metadata from: "+allmetadatasfile
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/xmlLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/xmlLoader.groovy	(revision 964)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xml/xmlLoader.groovy	(revision 965)
@@ -129,7 +129,7 @@
 	println " stop if a XML source is malformed: "+stopIfMalformed
 }
 
-File allmetadatasfile = new File(srcDir, "metadata.csv");
+File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
 
 // Apply XSL
 if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
Index: tmp/org.txm.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 964)
+++ tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 965)
@@ -1,12 +1,15 @@
 Manifest-Version: 1.0
-Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexp
- ort,org.txm.libs.groovy-all;bundle-version="1.0.0";visibility:=reexpo
- rt,org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexp
- ort,org.eclipse.osgi.util;bundle-version="3.2.0";visibility:=reexport
- ,org.eclipse.core.net;visibility:=reexport,org.eclipse.osgi;visibilit
- y:=reexport,org.eclipse.ui.workbench;visibility:=reexport,org.eclipse
- .core.commands;visibility:=reexport,org.eclipse.core.resources;visibi
- lity:=reexport
+Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.libs.groovy-all;bundle-version="1.0.0";visibility:=reexport,
+ org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
+ org.eclipse.osgi.util;bundle-version="3.2.0";visibility:=reexport,
+ org.eclipse.core.net;visibility:=reexport,
+ org.eclipse.osgi;visibility:=reexport,
+ org.eclipse.ui.workbench;visibility:=reexport,
+ org.eclipse.core.commands;visibility:=reexport,
+ org.eclipse.core.resources;visibility:=reexport,
+ org.txm.libs.office;bundle-version="0.0.0",
+ org.txm.libs.msoffice;bundle-version="1.0.0"
 Export-Package: .,
  EDU.oswego.cs.dl.util.concurrent,
  EDU.oswego.cs.dl.util.concurrent.misc,
Index: tmp/org.txm.core/src/java/org/txm/metadatas/Metadatas.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/metadatas/Metadatas.java	(revision 964)
+++ tmp/org.txm.core/src/java/org/txm/metadatas/Metadatas.java	(revision 965)
@@ -31,6 +31,7 @@
 
 import java.io.BufferedWriter;
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
@@ -61,8 +62,14 @@
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
+import org.odftoolkit.odfdom.dom.element.table.TableTableElement;
+import org.odftoolkit.simple.SpreadsheetDocument;
+import org.odftoolkit.simple.table.Row;
+import org.odftoolkit.simple.table.Table;
 import org.txm.importer.AddAttributeInXml;
 import org.txm.importer.PersonalNamespaceContext;
+import org.txm.libs.msoffice.ReadExcel;
+import org.txm.libs.office.ReadODS;
 import org.txm.utils.AsciiUtils;
 import org.txm.utils.CsvReader;
 import org.txm.utils.Pair;
@@ -77,19 +84,19 @@
  * The Class Metadatas.
  */
 public class Metadatas extends LinkedHashMap<String , TextInjection> {
-	
+
 	/** Load metadatas from a xml file $lt;metadatas> $lt;meta key="key1"> $lt;entry name="attr1" value="value1"/> $lt;entry name="attr1" value="value1"/> $lt;meta/> $lt;/metadatas>. */
 	File xmlfile;
-	
+
 	/** The metadatas. */
 	ArrayList<Metadata> metadatas = new ArrayList<Metadata>();
-	
+
 	/** The headers list. */
 	ArrayList<String> headersList = new ArrayList<String>();
-	
+
 	/** The isinialize. */
 	boolean isinialize = false;
-	
+
 	/**
 	 * Checks if is initialized.
 	 *
@@ -99,10 +106,10 @@
 	{
 		return isinialize;
 	}
-	
+
 	/** The ns context. */
 	NamespaceContext nsContext = new PersonalNamespaceContext();
-	
+
 	/**
 	 * Instantiates a new metadatas.
 	 *
@@ -114,41 +121,168 @@
 		if(!initialize())
 			System.out.println("Error: failed to load metadata from the file "+xmlfile);
 	}
+
+	/**
+	 * Find a metadata file in a directory
+	 * 
+	 * @param directory
+	 * @return an input file, try in order : ods, xlsx, tsv and finally csv extension
+	 */
+	public static File findMetadataFile(File directory) {
+		File f = new File(directory, "metadata.ods");
+		if (f.exists()) return f;
+		
+		f = new File(directory, "metadata.xlsx");
+		if (f.exists()) return f;
+		
+		f = new File(directory, "metadata.tsv");
+		if (f.exists()) return f;
+		
+		f = new File(directory, "metadata.csv");
+		if (f.exists()) return f;
+		
+		return null;
+	}
 	
 	/**
-	 * Instantiates a new metadatas.
+	 * Instantiates a new metadatas using an input file : ods, xlsx, tsv or csv.
 	 *
-	 * @param csvfile the csvfile
+	 * @param inputFile the CSV, XSLS or ODS
 	 * @param encoding the encoding
 	 * @param separator the separator
 	 * @param nbheaderline the nbheaderline
 	 */
-	public Metadatas(File csvfile, String encoding, String separator, String txtseparator, int nbheaderline)
+	public Metadatas(File inputFile, String encoding, String separator, String txtseparator, int nbheaderline)
 	{
-		File xmlfile = new File(csvfile.getParent(), csvfile.getName()+".xml");
+		File xmlfile = new File(inputFile.getParent(), inputFile.getName()+".xml");
 		//println "create xml file version of "+csvfile+" : "+xmlfile
 		try {
-			if(convertCsvToXml(csvfile, xmlfile, encoding, separator, txtseparator, nbheaderline))
-			{	
-				this.xmlfile = xmlfile;
-				//println "xml file : "+xmlfile
-				if(!initialize())
-					System.out.println("Error: failed to load metadata from the file "+xmlfile);
+			if (inputFile.getName().endsWith(".ods")) {
+				if (convertODSToXml(inputFile, xmlfile)) {	
+					this.xmlfile = xmlfile;
+					//println "xml file : "+xmlfile
+
+				}
+			} else if (inputFile.getName().endsWith(".xlsx")) {
+				if (convertXLSXToXml(inputFile, xmlfile)) {	
+					this.xmlfile = xmlfile;
+					//println "xml file : "+xmlfile
+
+				}
+			} else if (inputFile.getName().endsWith(".tsv")) {
+				if (convertCsvToXml(inputFile, xmlfile, encoding, "\t", "", 0)) {	
+					this.xmlfile = xmlfile;
+					//println "xml file : "+xmlfile
+
+				}
+			} else {
+				if (convertCsvToXml(inputFile, xmlfile, encoding, separator, txtseparator, nbheaderline)) {	
+					this.xmlfile = xmlfile;
+					//println "xml file : "+xmlfile
+
+				}
 			}
+
+			if (!initialize()) {
+				System.out.println("Error: failed to load metadata from the file "+xmlfile);
+			}
 		} catch (Exception e) {
 			// TODO Auto-generated catch block
 			org.txm.utils.logger.Log.printStackTrace(e);
 			Log.severe(e.toString());
 		}
 	}
-	
+
+	private boolean convertXLSXToXml(File inputFile, File xmlFile) throws Exception {
+		ArrayList<ArrayList<String>> data = ReadExcel.toTable(inputFile, "metadata");
+		System.out.println(data);
+		return data.size() > 0 && convertTableToXml(data, xmlFile);
+	}
+
+	private boolean convertTableToXml(ArrayList<ArrayList<String>> data, File xmlFile) throws Exception {
+		XMLOutputFactory factory = XMLOutputFactory.newInstance();
+		FileOutputStream output = new FileOutputStream(xmlFile);
+		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");//create a new file
+
+		writer.writeStartDocument("UTF-8", "1.0");
+		writer.writeCharacters("\n");
+		writer.writeStartElement("enrichissement");
+		writer.writeCharacters("\n");
+		writer.writeStartElement("metadatas");
+		writer.writeCharacters("\n");
+
+		ArrayList<String> headers = data.get(0); // first line
+
+		for (int i = 1 ; i < headers.size() ; i++) {
+			if (headers.get(i).length() == 0) {
+				headers.set(i, "noname");
+				System.out.println("Warning: the "+(i+1)+"the column name is empty");
+			}
+			//if(!headers[i].equals("id"))// the first
+			//{
+			writer.writeStartElement("metadata");
+			writer.writeAttribute("id", AsciiUtils.buildId(headers.get(i)));
+			writer.writeAttribute("shortname", headers.get(i));
+			writer.writeAttribute("longname", headers.get(i));
+			writer.writeAttribute("type", "String");
+			writer.writeAttribute("colwidth", "100");
+			writer.writeAttribute("selection", "true");
+			writer.writeAttribute("partition", "true");
+			writer.writeAttribute("display", "true");
+
+			writer.writeEndElement();
+			writer.writeCharacters("\n");
+			//}	
+		}
+		writer.writeEndElement(); //close metadatas
+		writer.writeCharacters("\n");
+
+		writer.writeStartElement("texts");
+		writer.writeCharacters("\n");
+		for (int i = 1 ; i < data.size() ; i++) { // the next lines
+			ArrayList<String> dataline = data.get(i);
+
+			writer.writeStartElement("text");
+
+			// write the id attribute 
+			for (int j = 0 ; j < headers.size() ; j++) {
+				if (headers.get(j).equals("id")) {
+					writer.writeAttribute("id", dataline.get(j));
+				}
+			}
+			// write the other attributes
+			for (int j = 0 ; j < headers.size() ; j++) {
+				if (!headers.get(j).equals("id")) {
+					writer.writeAttribute(headers.get(j), dataline.get(j));
+				}
+			}
+			writer.writeEndElement();
+			writer.writeCharacters("\n");
+		}
+		writer.writeEndElement();//close texts
+		writer.writeCharacters("\n");
+		writer.writeEndElement();//close metadatas
+
+		writer.close();
+		output.close();
+
+		writer.close();
+		return true;
+	}
+
+	private boolean convertODSToXml(File inputFile, File xmlFile) throws Exception {
+		ArrayList<ArrayList<String>> data = ReadODS.toTable(inputFile, "metadata");
+
+		return data.size() > 0 && convertTableToXml(data, xmlFile);
+	}
+
 	public File getXMLFile() {
 		return xmlfile;
 	}
-	
+
 	/** The sattr. */
 	String sattr = "";
-	
+
 	/**
 	 * Initialize.
 	 *
@@ -183,7 +317,7 @@
 			sattr +="+"+m.id;
 			headersList.add(m.id);
 		}
-		
+
 		// List<Node> Lmetadatas = doc.texts.text;
 		// get metadata nodes
 		NodeList textsNodes = doc.getElementsByTagName("texts");
@@ -198,18 +332,18 @@
 			TextInjection inj = new TextInjection(e);
 			this.put(inj.id, inj);
 		}
-		
+
 		isinialize = true;
 		return true;
 	}
-	
+
 	public HashMap<String, String> getTextMetadata(File f)
 	{
 		HashMap<String, String> data = new HashMap<String, String>();
 		String txtname = f.getName();
 		int idx = txtname.lastIndexOf(".");
 		if(idx > 0) txtname = txtname.substring(0, idx);
-		
+
 		TextInjection injection = this.get(txtname);
 		if (injection == null) {
 			System.out.println("Could not find injection for text "+txtname);
@@ -218,10 +352,10 @@
 		for (Entry e : injection) {
 			data.put(e.getId(), e.getValue());
 		}
-		
+
 		return data;
 	}
-	
+
 	/**
 	 * Convert csv to xml.
 	 *
@@ -248,31 +382,31 @@
 			System.out.println("Error: CSV file does not exists");
 			return false;
 		}
-		
+
 		XMLOutputFactory factory = XMLOutputFactory.newInstance();
 		FileOutputStream output = new FileOutputStream(xmlFile);
 		XMLStreamWriter writer = factory.createXMLStreamWriter(output, "UTF-8");//create a new file
-		
+
 		CsvReader reader = new CsvReader(csvfile.getAbsolutePath(), separator.charAt(0), Charset.forName(encoding));
 		if (txtseparator != null && txtseparator.length() > 0)
 			reader.setTextQualifier(txtseparator.charAt(0));
-		
+
 		reader.readHeaders();
-		
+
 		String[] headers = reader.getHeaders();
-		
+
 		if (headers.length == 0)
 		{
 			System.out.println("Error: No header in the metadata file "+csvfile);
 			return false;
 		}
-		
+
 		if(!headers[0].equals("id"))
 		{
 			System.out.println("Error: The first column name in the header line of the metadata file '$csvfile' must be 'id' and found '"+headers[0]+"'");
 			return false;
 		}
-			
+
 		//check for double columns
 		HashSet<String> testhash = new HashSet<String>();
 		HashSet<String> doubles = new HashSet<String>();
@@ -287,7 +421,7 @@
 			System.out.println("Error: the metadata file '$csvfile' contains duplicated column names: "+doubles);
 			return false;
 		}
-		
+
 		String[] longnames = new String[headers.length];
 		String[] types = new String[headers.length];
 		if (nbheaderline > 1)//get longnames
@@ -301,7 +435,7 @@
 			for (int i = 0 ; i < headers.length ; i++) {
 				longnames[i] = headers[i];
 			}
-		
+
 		if (nbheaderline > 2)//got types
 		{
 			reader.readRecord();
@@ -316,10 +450,11 @@
 				types[i] = "String";
 			}
 		}
-		
+
 		writer.writeStartDocument("UTF-8", "1.0");
 		writer.writeStartElement("enrichissement");
 		writer.writeStartElement("metadatas");
+		writer.writeCharacters("\n");
 		//println "headers : "+Arrays.toString(headers)
 		for (int i = 1 ; i < headers.length ; i++) {
 			if (headers[i].length() == 0) {
@@ -337,13 +472,16 @@
 			writer.writeAttribute("selection", "true");
 			writer.writeAttribute("partition", "true");
 			writer.writeAttribute("display", "true");
-			
+
 			writer.writeEndElement();
+			writer.writeCharacters("\n");
 			//}	
 		}
 		writer.writeEndElement();//close metadatas
+		writer.writeCharacters("\n");
 		
 		writer.writeStartElement("texts");
+		writer.writeCharacters("\n");
 		while (reader.readRecord())	{
 			writer.writeStartElement("text");
 			for(int i = 0 ; i < headers.length ; i++)
@@ -352,7 +490,7 @@
 				} else if(headers[i].equals("xpath")) {
 					writer.writeAttribute("xpath", reader.get(headers[i]));
 				}
-			
+
 			for(int i = 0 ; i < headers.length ; i++)
 				if(!headers[i].equals("id") && !headers[i].equals("xpath"))
 				{
@@ -363,22 +501,24 @@
 						writer.writeAttribute("value", "N/A");
 					else
 						writer.writeAttribute("value", value);
-					
+
 				}
 			writer.writeEndElement();
+			writer.writeCharacters("\n");
 		}
 		writer.writeEndElement();//close texts
+		writer.writeCharacters("\n");
 		writer.writeEndElement();//close metadatas
-		
+
 		reader.close();
 		writer.close();
 		output.close();
-		
+
 		output = null;
 		writer = null;
 		return true;
 	}
-	
+
 	/**
 	 * Keep only metadatas.
 	 *
@@ -398,7 +538,7 @@
 				i--;
 			}
 		}
-		
+
 		for(TextInjection inj : this.values())
 		{
 			for(int i = 0 ; i < inj.size() ; i++)
@@ -412,7 +552,7 @@
 			}
 		}
 	}
-	
+
 	/**
 	 * Inject metadatas in xml txm.
 	 *
@@ -427,7 +567,7 @@
 	{
 		return injectMetadatasInXml(infile, outfile,"text", "tei");
 	}
-	
+
 	/**
 	 * Inject metadatas in xml.
 	 *
@@ -443,7 +583,7 @@
 	{
 		return injectMetadatasInXml(infile, outfile,tag, null);
 	}
-	
+
 	/**
 	 * Inject metadatas in xml.
 	 *
@@ -461,20 +601,20 @@
 		String key = infile.getName();
 		if(key.lastIndexOf(".") > 0)
 			key = key.substring(0, key.lastIndexOf("."));
-		
+
 		ArrayList<org.txm.metadatas.Entry> metas = get(key);
-		
+
 		if (metas == null) {
 			System.out.println("\nError: can't find metadata for text of id="+key);
 			System.out.println("Maybe the metadata file doesn't have the right format (comma separated values are needed)");
 			return false;
 		}
-		
+
 		AddAttributeInXml builder = new AddAttributeInXml(infile, tag, metas);
 		builder.onlyOneElement();
 		return builder.process(outfile);
 	}
-	
+
 	/**
 	 * Save.
 	 *
@@ -487,18 +627,18 @@
 		try {
 			// Création de la source DOM
 			Source source = new DOMSource(doc);
-			
+
 			// Création du fichier de sortie
 			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), "UTF-8")); 
 			Result resultat = new StreamResult(writer);
-			
+
 			// Configuration du transformer
 			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
 			Transformer transformer = fabrique.newTransformer();
 			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
 			transformer.setOutputProperty(OutputKeys.METHOD, "xml");
 			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
-			
+
 			// Transformation
 			transformer.transform(source, resultat);
 			writer.close();
@@ -509,7 +649,7 @@
 			return false;
 		}
 	}
-	
+
 	/**
 	 * Insert.
 	 *
@@ -524,10 +664,10 @@
 		//println ("insert $pairs into $xpath")
 		XPathFactory factory = XPathFactory.newInstance();
 		XPath XpathObj = factory.newXPath();
-		
+
 		XpathObj.setNamespaceContext(nsContext);
 		XPathExpression expr = XpathObj.compile(xpath);
-		
+
 		NodeList nodes = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
 		int count = 0;
 		for(int i = 0 ; i < nodes.getLength() ; i++) {
@@ -539,7 +679,7 @@
 			}
 			count++;
 		}
-		
+
 		factory = null;
 		XpathObj = null;
 		expr = null;
@@ -551,7 +691,7 @@
 			return false;
 		}
 	}
-	
+
 	/**
 	 * Gets the property names.
 	 *
@@ -561,7 +701,7 @@
 	{
 		return headersList;
 	}
-	
+
 	/**
 	 * Gets the sattributes.
 	 *
@@ -574,41 +714,39 @@
 			sattr += "+"+attr;
 		return sattr;
 	}
-	
+
 	/* (non-Javadoc)
 	 * @see java.util.AbstractMap#toString()
 	 */
 	@Override
-	public String toString()
-	{
+	public String toString() {
 		StringBuffer str = new StringBuffer();
 		str.append("Metadata: \n");
-		for(Metadata data : metadatas)
+		for (Metadata data : metadatas) {
 			str.append(" "+data.toString()+"\n");
-		
+		}
+
 		str.append("Injections: \n");
-		for(TextInjection injection : this.values())
-		{
+		for(TextInjection injection : this.values()) {
 			str.append(" "+injection.toString()+"\n");
 		}
 		return str.toString();
 	}
-	
+
 	/**
 	 * The main method.
 	 *
 	 * @param args the arguments
 	 */
-	public static void main(String[] args)
-	{
+	public static void main(String[] args) {
 		String userhome = System.getProperty("user.home");
 		File xmlfile = new File(userhome, "/xml/metadata.xml");
 		File csvfile = new File(userhome, "/xml/metadata.csv");
+		File odsfile = new File(userhome, "/xml/metadata.ods");
+		File xlsxfile = new File(userhome, "/xml/metadata.xlsx");
 
-		Metadatas m = new Metadatas(csvfile, "UTF-8", ",","\"", 1);
-		if(m.isInitialized())
-		{
-			String[] okmetadatas = {"date", "lieu"};
+		Metadatas m = new Metadatas(odsfile, "UTF-8", ",","\"", 1);
+		if (m.isInitialized()) {
 			System.out.println(m.toString());
 		}
 	}
@@ -616,7 +754,7 @@
 	public ArrayList<Metadata> getMetadatas() {
 		return metadatas;
 	}	
-	
+
 	public ArrayList<String> getHeadersList(){
 		return this.headersList;
 	}
