我的工程團隊正準備對一個公共專案進行投標,該專案的規格檔案很大(約 500 頁)。我想在電子表格中逐條分解它,然后為團隊分配相關的“部分”。我檢查了,但 PDF 檔案是提供這些規格的唯一方式。
我們的想法是記錄它,以便我們可以將它與以類似方式記錄的先前專案的規范進行比較。我仍然是一名實習生,所以不知道這個程序在不同的公司是如何運作的,但在我的團隊中,最后一個專案是以類似的方式手動記錄的。
這些頁面以索引段落(如 1、1.1、1.1.1 等)排列,并帶有一些表格和數字。
我希望得到這樣的表:
| 條款號 | 條款 |
|---|---|
| 1.1。 | Lorem Ipsum |
| 1.2. | Lorem Ipsum |
我在 PM Stackexchange 上詢問是否有人對任何軟體套件有一些想法,但我認為沒有很多。
所以我轉向 R 希望我可以通過使用 pdftools 和正則運算式決議它來解決這個問題,通常,在檢查代碼時,我可以讓它在某種程度上在 regex101.com 上運行(隨機選擇幾個段落,但失敗了當遇到一個表時)但不知何故它在與 R 一起使用時不會回傳相同的回應。
我沒有承諾使用 R,但只是因為它在我的作業筆記本電腦上很容易使用。也愿意嘗試 python 或任何其他工具包。
到目前為止,我一直堅持讓 R 得到一個段落。
library(pdftools)
library(dplyr)
library(stringr)
library(purrr)
setwd("The work Dir/")
specDoc <- pdf_text("Spec Doc.pdf") %>% strsplit(split = "\n")
specDocChar <- as.character(specDoc)
get_clause <- str_trim(str_extract(specDocChar, "(?:^\n*(?:\\d\\.(?:\\d\\.)*) )(. ?)$"))
get_clause
我也試過了lookbehind,但它似乎不適用于靈活的起始字串長度。
在這一點上,我主要想知道兩件事。
- 我做錯了什么,我最終有一個空白輸出
- 有沒有更有效的方法來解決這個特定的問題,因為在段落之后,我不確定如何管理段落內的表格,而僅 para 需要太多時間。

Google 只會提供不帶 css 的文本(除非您直接在 HTML 刮板中修改該 html)

你有源檔案(谷歌下載的那個)。
因此,您應該已經擁有的一個應用程式是提取文本的最佳選擇。

Clearly there are limitations such as no graphics or divisions like in the HTML. However if you just need to send the text to a bid collaborator for comment/action by referring to pdf named destinations (bookmarks) it is fast dirty and simple, more time to do your own bidding. Simpler may be to export eXcelX paragraphs from a cheap PDF editor like Xchange. or use adobe to convert to docx

If you have your plain text you can paste or open in Word to apply styling, if needed.

However if there are tables to be redefined you can open the plain text in Office to draw the tables, here I set the first division on import between the numbers and body text and am redefining the table sub division.

I mentioned in comments that the most frequent way to address matching locations between documents is to use hyperlinks. Here is an example where the link to the table has been added to the sample document. And that can be used to call a corresponding location in another viewer or document. To build such a method will take time to develop across uses but it means that auto bookmaking may be the easy way to navigate between paired entries kept iin a spreadsheet of related links (I would on occasion have up to 4 cells in a row).

轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/489400.html
