Index: /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/main/TransformAllMaps.java
===================================================================
--- /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/main/TransformAllMaps.java	(revision 6707)
+++ /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/main/TransformAllMaps.java	(revision 6708)
@@ -8,5 +8,4 @@
 import eu.clarin.cmdi.vlo.pojo.Constants;
 import eu.clarin.cmdi.vlo.transformers.CSVTransformer;
-import eu.clarin.cmdi.vlo.transformers.XML2CSVTransformer;
 
 public class TransformAllMaps {
Index: /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/pojo/Constants.java
===================================================================
--- /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/pojo/Constants.java	(revision 6707)
+++ /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/pojo/Constants.java	(revision 6708)
@@ -8,4 +8,5 @@
 	//PATHS
 	public static final String CSV_PATH = "maps/csv/";
+	public static final String EXCEL_PATH = "maps/excel/";
 	public static final String MAPS_PATH = "maps/uniform_maps/";
 	
@@ -18,5 +19,5 @@
 	public static final String LANGUAGE_CODE = "LanguageNameVariantsMap";
 	public static final String LICENCE = "LicenseAvailabilityMap";
-	public static final String RESOURCE_TYPE = "resourceTypeMap";
+	public static final String RESOURCE_TYPE = "ACDH_resourceType";
 	public static final String NATIONAL_PROJECT = "nationalProjectsMapping";
 	public static final String ORGANISATION = "OrganisationControlledVocabulary";
@@ -25,8 +26,8 @@
 	
 	static{
-		maps.add(LANGUAGE_CODE);
-		maps.add(LICENCE);
-		maps.add(NATIONAL_PROJECT);
-		maps.add(ORGANISATION);
+//		maps.add(LANGUAGE_CODE);
+//		maps.add(LICENCE);
+//		maps.add(NATIONAL_PROJECT);
+//		maps.add(ORGANISATION);
 		maps.add(RESOURCE_TYPE);
 	}
Index: /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/transformers/CSVTransformer.java
===================================================================
--- /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/transformers/CSVTransformer.java	(revision 6707)
+++ /vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/transformers/CSVTransformer.java	(revision 6708)
@@ -17,4 +17,5 @@
 import javax.xml.bind.JAXBException;
 
+import org.apache.poi.util.ArrayUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,6 +53,6 @@
 		_logger.info("reading from file {}{}.xml.", Constants.MAPS_PATH, map);
 		InputStream input = new FileInputStream(Constants.MAPS_PATH + map + ".xml");
-		_logger.info("output will be saved into {}{}.csv.", Constants.CSV_PATH, map);
-		OutputStream output = new FileOutputStream(Constants.CSV_PATH + map + ".csv");
+		_logger.info("output will be saved into {}{}.txt.", Constants.CSV_PATH, map);
+		OutputStream output = new FileOutputStream(Constants.CSV_PATH + map + ".txt");
 		
 		xml2csv(input, output);
@@ -80,6 +81,6 @@
 	
 	public synchronized void csv2xml(String map) throws IOException, JAXBException{
-		_logger.info("reading from file {}{}.csv.", Constants.CSV_PATH, map);
-		InputStream input = new FileInputStream(Constants.CSV_PATH + map + ".csv");
+		_logger.info("reading from file {}{}.txt.", Constants.CSV_PATH, map);
+		InputStream input = new FileInputStream(Constants.CSV_PATH + map + ".txt");
 		_logger.info("output will be saved into {}{}.xml.", Constants.MAPS_PATH, map);
 	    OutputStream output = new FileOutputStream(Constants.MAPS_PATH + map + ".xml");
@@ -180,4 +181,5 @@
     private VariantsMap csv2xmlTransformer(BufferedReader br) throws IOException{
     	boolean regExpresionExists = false;
+    	boolean remarksExists = false;
     	VariantsMap map = new VariantsMap();
     	map.setMappings(new ArrayList<Mapping>());
@@ -187,80 +189,93 @@
     	
     	String line = br.readLine();
-    	
-    	//process column names	
-    	if(!line.contains(Constants.NORMALIZED_VALUE))
-    		throw new RuntimeException("The first row of CSV file must contain column names");
-    	_logger.info("CSV file contains following headers {}", line);
-    	
-    	for(String col: line.split("\\t")){    	
-    		if(col.equals(Constants.REMARKS))
-    			break;//last column - don't need it in xml map
-    		
-    		if(col.equals(Constants.REGULAR_EXPRESSION))
-    			regExpresionExists = true;
-    		columnNames.add(col.toLowerCase());
-    		
-    	}    	
-    	    	
-    	while ((line = br.readLine()) != null) {
-    		csvRowCnt++;
-    		while(line.charAt(line.length() - 1) != '\t'){//line must end with a tab, otherwise means that value contains line break -> &#xA;
-    			_logger.debug("line {} contains line break!", csvRowCnt);
-    			line += "\n" + br.readLine();
-    		}
-    			
-    		String[] tokens = line.split("\\t");
-    		String normalizedVal = regExpresionExists? tokens[3] : tokens[2];
-    		
-    		if(normalizedVal.isEmpty())
-    			throw new RuntimeException("Normalized value (the 4th column) is mandatory");    		
-    		    		
-    		Variant var = null;
-    		
-    		if(!tokens[0].isEmpty()){ // Organization vocab has normalized values without variants
-    			var = new Variant();
-    			var.setValue(tokens[0]);
-    			_logger.debug("new varinat was found, variant value is {}. ", var.getValue());
-        		
-        		//we are setting regEx attr only if it's true
-        		if(regExpresionExists && tokens[1].toLowerCase().equals("true"))
-        			var.setRegExp(true);
-        		List<CrossMapping> crossMappings = new ArrayList<CrossMapping>();
-        		for(int i = regExpresionExists? 4 : 3; i < tokens.length; i++){
-        			if(tokens[i].isEmpty()) //skip when val is null (empty)
-        				continue;
+    	try{
+    		//process column names	
+        	if(!line.contains(Constants.NORMALIZED_VALUE))
+        		throw new RuntimeException("The first row of CSV file must contain column names");
+        	_logger.info("CSV file contains following headers {}", line);
+        	
+        	for(String col: line.split("\\t")){    	
+        		if(col.toUpperCase().equals(Constants.REMARKS)){
+        			remarksExists = true;
+        			break;//last column - don't need it in xml map
+        		}
+        		
+        		if(col.toUpperCase().equals(Constants.REGULAR_EXPRESSION))
+        			regExpresionExists = true;
+        		columnNames.add(col.toLowerCase());
+        		
+        	}    	
+        	    	
+        	while ((line = br.readLine()) != null) {
+        		csvRowCnt++;
+        		while(!remarksExists && line.charAt(line.length() - 1) != '\t'){//line must end with a tab, otherwise means that value contains line break -> &#xA;
+        			_logger.debug("line {} contains line break!", csvRowCnt);
+        			line += "\n" + br.readLine();
+        		}
         			
-        			CrossMapping crossMapping = new CrossMapping();
-        			crossMapping.setFacet(columnNames.get(i));
-        			crossMapping.setValue(tokens[i]);
-        			crossMappings.add(crossMapping);
-        			_logger.debug("new cross-mapping was found {}:{} ", crossMapping.getFacet(), crossMapping.getValue());
-        		}//end cross-mappings
-        		
-        		if(crossMappings.size() > 0)
-        			var.setCrossMappings(crossMappings);
-    		}
-    		
-    		Mapping mapping = processedNormalizedVals.get(normalizedVal);
-    		if(mapping == null){
-    			mapping = new Mapping();
-    			mapping.setValue(normalizedVal);
-    			processedNormalizedVals.put(normalizedVal, mapping);
-    			_logger.debug("new mapping was found, normalized value is {}", mapping.getValue());
-    			csvNormValsCnt++;
-    		}
-    		if(var != null){
-    			mapping.getVariants().add(var);
-    		}else{
-    			mapping.setVariants(null); //to skip it in XML
-    		}
-    		
-    		
- 	    }//end while
-    	
-    	map.setField(columnNames.get(0));
-    	for(String s: processedNormalizedVals.keySet()){
-    		map.getMappings().add(processedNormalizedVals.get(s));
+        		String[] tokens = line.split("\\t");
+        		if(remarksExists && tokens.length == columnNames.size() + 1){ //remove last col (remarks)
+        			String[] tokenstWithoutRemarks = new String[tokens.length - 1];
+        			System.arraycopy(tokens, 0, tokenstWithoutRemarks, 0, tokenstWithoutRemarks.length);
+        			tokens = tokenstWithoutRemarks;
+        		}
+        		
+        		String normalizedVal = regExpresionExists? tokens[3] : tokens[2];
+        		
+        		if(normalizedVal.isEmpty())
+        			throw new RuntimeException("Normalized value (the 4th column) is mandatory");    		
+        		    		
+        		Variant var = null;
+        		
+        		if(!tokens[0].isEmpty()){ // Organization vocab has normalized values without variants
+        			var = new Variant();
+        			var.setValue(tokens[0]);
+        			_logger.debug("new varinat was found, variant value is {}. ", var.getValue());
+            		
+            		//we are setting regEx attr only if it's true
+            		if(regExpresionExists && tokens[1].toLowerCase().equals("true"))
+            			var.setRegExp(true);
+            		List<CrossMapping> crossMappings = new ArrayList<CrossMapping>();
+            		for(int i = regExpresionExists? 4 : 3; i < tokens.length; i++){
+            			if(tokens[i].isEmpty()) //skip when val is null (empty)
+            				continue;
+            			
+            			CrossMapping crossMapping = new CrossMapping();
+            			crossMapping.setFacet(columnNames.get(i));
+            			crossMapping.setValue(tokens[i]);
+            			crossMappings.add(crossMapping);
+            			_logger.debug("new cross-mapping was found {}:{} ", crossMapping.getFacet(), crossMapping.getValue());
+            		}//end cross-mappings
+            		
+            		if(crossMappings.size() > 0)
+            			var.setCrossMappings(crossMappings);
+        		}
+        		
+        		Mapping mapping = processedNormalizedVals.get(normalizedVal);
+        		if(mapping == null){
+        			mapping = new Mapping();
+        			mapping.setValue(normalizedVal);
+        			processedNormalizedVals.put(normalizedVal, mapping);
+        			_logger.debug("new mapping was found, normalized value is {}", mapping.getValue());
+        			csvNormValsCnt++;
+        		}
+        		if(var != null){
+        			mapping.getVariants().add(var);
+        		}else{
+        			mapping.setVariants(null); //to skip it in XML
+        		}
+        		
+        		
+     	    }//end while
+        	
+        	map.setField(columnNames.get(0));
+        	for(String s: processedNormalizedVals.keySet()){
+        		map.getMappings().add(processedNormalizedVals.get(s));
+        	}
+    	}catch(Exception e){
+    		_logger.error("Error on line {}", line, e);
     	}
+    	
+    	
 
     	
