package test;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class y {
/**
* @param args
*/
public static void main(String[] args) {
List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
Map<String,Object> map = new HashMap<String, Object>();
map.put("yunt","yuuuu");
map.put("ttt","yuuuusss");
list.add(map);
Map<String,Object> map1 = new HashMap<String, Object>();
map1.put("yunt","fdffd");
map1.put("ttt","s");
list.add(map1);
FileWriter outFile = null;
BufferedWriter writer = null;
try {
outFile = new FileWriter("E:/FineReport_8.0/WebReport/WEB-INF/reportlets/tet.txt");
writer= new BufferedWriter(outFile);
for(int i =0;i<list.size();i++){
Map<String,Object> maps= list.get(i);
String t ="";
for (String key :maps.keySet()) {
t+=maps.get(key)+",";
}
t=t.substring(0,t.length()-1);
writer.write(t);
writer.newLine();
}
writer.flush();
writer.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class y {
/**
* @param args
*/
public static void main(String[] args) {
List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
Map<String,Object> map = new HashMap<String, Object>();
map.put("yunt","yuuuu");
map.put("ttt","yuuuusss");
list.add(map);
Map<String,Object> map1 = new HashMap<String, Object>();
map1.put("yunt","fdffd");
map1.put("ttt","s");
list.add(map1);
FileWriter outFile = null;
BufferedWriter writer = null;
try {
outFile = new FileWriter("E:/FineReport_8.0/WebReport/WEB-INF/reportlets/tet.txt");
writer= new BufferedWriter(outFile);
for(int i =0;i<list.size();i++){
Map<String,Object> maps= list.get(i);
String t ="";
for (String key :maps.keySet()) {
t+=maps.get(key)+",";
}
t=t.substring(0,t.length()-1);
writer.write(t);
writer.newLine();
}
writer.flush();
writer.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}