importjava.io.FileOutputStream;importjava.util.HashMap;importjava.util.Iterator;importjava.util.List;importjava.util.Map;importjava.util.Map.Entry;importorg.apache.poi.POIXMLDocument;importorg.apache.poi.xwpf.usermodel.XWPFDocument;importorg.apache.poi.xwpf.usermodel.XWPFTable;importorg.apache.poi.xwpf.usermodel.XWPFTableCell;importorg.apache.poi.xwpf.usermodel.XWPFTableRow;public classDOCWriter {public static voidsearchAndReplace(String srcPath, String destPath,
Mapmap) {try{
XWPFDocument document= newXWPFDocument(POIXMLDocument
.openPackage(srcPath));
Iterator it=document.getTablesIterator();while(it.hasNext()) {
XWPFTable table=(XWPFTable) it.next();int rcount =table.getNumberOfRows();for (int i = 0; i < rcount; i++) {
XWPFTableRow row=table.getRow(i);
List cells =row.getTableCells();for(XWPFTableCell cell : cells) {for (Ent