| | |
| | | "startRow": 1, |
| | | |
| | | "//结束行号,从0开始,不包含该行": "//", |
| | | "endRow": 2001, |
| | | "endRow": 200, |
| | | |
| | | "//线程数": "//", |
| | | "threadSize": 4, |
| | | "threadSize": 10, |
| | | |
| | | "//定时结束时间,单位分钟,0表示不设置定时结束时间": "//", |
| | | "endOfTime": 0, |
| | |
| | | text = /(.|\n)*<pre>((.|\n)*)<\/pre>(.|\n)*/g.exec(text)[2]; |
| | | fs.writeFileSync(filepath, text, 'utf-8'); |
| | | } |
| | | try { |
| | | fs.writeFileSync(filepath + '.result.txt', cleanText(text), 'utf-8'); |
| | | } catch (e) { |
| | | reject(e); |
| | | try { |
| | | out.close(); |
| | | fs.unlink(filepath, (e) => console.error(e)); |
| | | } catch (e) { |
| | | console.error(e); |
| | | } |
| | | } |
| | | }, 1000); |
| | | resolve(true); |
| | | }); |
| | |
| | | main(); |
| | | } |
| | | |
| | | // const filepath = "D:\\projects\\book-crawler\\downloads\\10231261 978-1-331-76167-9.txt"; |
| | | // const text = fs.readFileSync(filepath, 'utf8'); |
| | | // fs.writeFileSync(filepath + '.result.txt', cleanText(text), 'utf-8'); |