public static void copyFailFile(String bugID) throws Exception {
File file = new File(".");
//get XML file path
String xmlFilePath = file.getCanonicalPath() + "\\Accounting Client\\results\\Accounting Client.xml";
//new XML file
String bugFilePath = file.getCanonicalPath() + "\\Accounting Client\\results\\" + bugID + ".xml";
//read XML file
BufferedReader reader = new BufferedReader(new FileReader(new File(xmlFilePath)));
//write XML file
BufferedWriter writer = new BufferedWriter(new FileWriter(new File(bugFilePath))); String line = "";
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null) {
if(line.contains(""")) {
line = line.replace(""", "\"");
}else if(line.contains(">")) {
line = line.replace(">", ">");
}
sb.append(line + "\n");
}
writer.append(sb.toString());
writer.flush();
writer.close();
reader.close();
}

最新文章

  1. RobotFramework自动化测试之脚本编写(一)
  2. DDD 领域驱动设计-看我如何应对业务需求变化?
  3. E2 2014.5.8 更新日志
  4. associated 2 maps
  5. Winedt10 添加自定义宏
  6. Eclipse中文乱码解决汇总(应该比较全):
  7. ENode框架初始化
  8. django进阶-3
  9. Redis——windows环境安装redis和redis sentinel部署
  10. python——Pycharm的简单介绍
  11. 如何利用GitHub搜索敏感信息
  12. idea取消vim模式
  13. VIM -小技巧汇总
  14. SQL Server 操作XML数据
  15. C# 反编译项目修复
  16. [转]学习C#:Attribute与Property
  17. PAT 甲级 1021 Deepest Root
  18. Bootstrap学习--基本格式
  19. Daily Scrum6 11.10
  20. CCLayer设置anchorPoint无效的问题

热门文章

  1. android的四种加载模式
  2. 『WPF』DataGrid的使用
  3. cocos2d-x游戏开发系列教程-坦克大战游戏之虚拟手柄的显示
  4. 【视频】零基础学Android开发:蓝牙聊天室APP(四)
  5. MFC 窗口重绘问题
  6. JENKINS 打包发布脚本
  7. FZOJ2111:Min Number
  8. spring mvc ModelAndView向前台传值
  9. 基于visual Studio2013解决面试题之0308Fibonacci数列
  10. hdu5086——Revenge of Segment Tree