feat: implement dynamic training course tab system and modular PDF data migration scripts
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import pdfplumber
|
||||
import json
|
||||
import re
|
||||
|
||||
filename = "/home/x79/sisvietnamvn_01/sisvietnamvn_Trang chính thức hiện tại/DaoTao/2.-CHUONG-TRINH-CAN-THIEP-MACH-MAU-THAN-KINH-NANG-CAO-BO-SUNG-FINAL.pdf"
|
||||
with pdfplumber.open(filename) as pdf:
|
||||
full_text = ""
|
||||
for page in pdf.pages:
|
||||
full_text += page.extract_text() + "\n"
|
||||
|
||||
print("Total length:", len(full_text))
|
||||
# Find all headings
|
||||
headings = re.findall(r'^(\d+)\.\s+(.*)$', full_text, re.MULTILINE)
|
||||
print("Headings found:")
|
||||
for h in headings:
|
||||
print(h)
|
||||
Reference in New Issue
Block a user