>" type. Please let me know how it can be " name="description">

Hi I have multiple text files. I want to read thoses files and store those records in map. Map will be of "LinkedHashMap<String, Map<String, String>>" type. Please let me know how it can be done?

Java read text files and store the value in a MAP
import java.io.*;
import java.util.*;
class OnlyExt implements FilenameFilter{
String ext;
public OnlyExt(String ext){
this.ext="." + ext;
}
public boolean accept(File dir,String name){
return name.endsWith(ext);
}
}
class MapExample{
public static void main(String[] args)throws Exception{
FilenameFilter ff = new OnlyExt("txt");
File folder = new File("c:/");
File[] files = folder.listFiles(ff);
Map<String,String> map=new LinkedHashMap<String,String>();
for(int i=0;i<files.length;i++){
FileReader fr = new FileReader(files[i].getPath());
BufferedReader reader = new BufferedReader(fr);
String st = "",str=" ";
while((st = reader.readLine()) != null) {
str+=st;
}
map.put(files[i].getName(),str);
}
Set set = map.entrySet();
Iterator i = set.iterator();
while(i.hasNext()){
Map.Entry me = (Map.Entry)i.next();
System.out.println(me.getKey() + " \t:\t " + me.getValue());
}
}
}

thanks for the answer... i am having 10 records in each file and i have 4 files. all 10 records from file 1 are inserted at first index. it behaves similarly for all. can you suggest me another option?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.