public static void ConvertToLibSVM(String directory,
			String outputDirectory) throws FileNotFoundException,IOException{
		FileReader fr     = new FileReader (directory);
		BufferedReader  br    = new BufferedReader(fr);
		FileWriter stream = new FileWriter(outputDirectory,false);
		BufferedWriter bo = new BufferedWriter(stream)	;
		int count=0;
		String line;
		int cc=0;
		while((line=br.readLine())!=null)
		{
			++cc;
			boolean flag=true;
			String [] array = line.split(",");
			String output="";
			String male="m";
			if(array[0].compareTo("1")==0)
			{
				output="1";
				//System.out.println("----"+array[0]+"-----");
			}
			else if(array[0].compareTo("2")==0)
			{
				output="2";
				//System.out.println("-1");
				//System.out.println("----"+array[0]+"-----");
			}
			else{
				output="3";
			}
			for(int i=1;i<array.length;i++)
			{   
				if(array[i].compareToIgnoreCase("Nan")==0)
				{
					flag=false;
				}
				if(array[i].compareToIgnoreCase("null")==0)
				{
					array[i]="0";
				}
				if(array[i].compareToIgnoreCase("0")!=0)
				{
					output+=" "+i+":"+array[i];
					
				}
				
				
			}
			if(flag==true)
			{
		    bo.write(output);
			bo.newLine();
			}
			else{
				//bo.write("-1 ");
				//bo.newLine();
				//System.out.println(++count+"  "+output);
			}
			
			
		}
		
		br.close();
		fr.close();
		bo.close();
		stream.close();
		
	}