系统集成项目管理工程师教程(第2版)带书签目录

您所在的位置:网站首页 系统集成贴吧 系统集成项目管理工程师教程(第2版)带书签目录

系统集成项目管理工程师教程(第2版)带书签目录

2023-10-12 03:53| 来源: 网络整理| 查看: 265

为什么80%的码农都做不了架构师?>>>   hot3.png

[官方指定考试教材] 系统集成项目管理工程师教程(第2版)带书签目录 

链接:https://pan.baidu.com/s/1qZi2YSG 密码:5q57

鉴于最近考试所需,考信息系统项目管理师的,也要把《系统集成项目管理工程师教程》学完,无奈网上的这本书都是没有书签目录的,要么就是带广告水印的,于是花了2天多的时间自己制作了一套书目录,现分享给有需要的朋友。

具体代码:

import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import org.apache.log4j.Logger; public class ReadAndWriteFile { static Logger log = Logger.getLogger(ReadAndWriteFile.class); public static int getPointCount(String string, String a) { String[] array = string.split(a); if (array != null) { if(!string.contains(".N")){ return (array.length - 1); }else{ return (array.length - 1)-1; } } return 0; } public static void readFileAndWriteFile(String fileName){ File file = new File(fileName); BufferedReader reader = null; try { // System.out.println("以行为单位读取文件内容,一次读一整行:"); reader = new BufferedReader(new FileReader(file)); String temp = null; String temp1 = null; String marker = ""; String markerEnd = ""; String markerStartAndEnd = ""; int line = 1; int titleLevel; List list = new ArrayList();//存储书签目录 // 一次读入一行,直到读入null为文件结束 while ((temp = reader.readLine()) != null) { String[] ss = new String[3];//[0]目录等级,[1]跳转页码,[2]标题 // 显示行号 // System.out.println("line " + line + ": " + temp); temp = temp.trim(); int pageNum = 0;//跳转页码 String titleContent = "";//标题 temp1 = temp; // temp1.replaceAll(".*[^\\d](?=(\\d+))","");//比如一个字符串:String filter = "1234gogogo67890",我想只获取后面的数字:即:67890。 pageNum = Integer.parseInt(temp1.replaceAll(".*[^\\d](?=(\\d+))",""))+36;//22是偏移值 titleContent = temp.substring(0,temp.length()-(pageNum+"").length()); int isPointCount = getPointCount(temp, "\\."); String regEx="第*章"; boolean result=Pattern.compile(regEx).matcher(temp).find(); if(result){ titleLevel = 1; ss[0]=titleLevel+""; } if(isPointCount == 1){ titleLevel = 2; ss[0]=titleLevel+""; }else if(isPointCount == 2){ titleLevel = 3; ss[0]=titleLevel+""; } ss[1]=pageNum+""; ss[2]=titleContent.trim(); list.add(ss); line++; } reader.close(); for(int i=0;i=0?(i-1):0;//上一标题 //i 本地标题 int k = (i+1)


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3