-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.py
More file actions
38 lines (28 loc) · 736 Bytes
/
parse.py
File metadata and controls
38 lines (28 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import PyPDF2
import datetime
def load_txt(file):
fp = open(file, "r")
draws = []
for line in fp.readlines():
draws.append(line.split())
print(line.split())
return draws
load_txt("roomdraw-2017.txt")
"""
fp = open('roomdraw-2017.txt', 'r')
draws = []
for line in fp.readlines():
draws.append(line.split())
print(draws)
# creating a pdf file object
pdfFileObj = open('AvailableRoomsList19-20.pdf', 'rb')
# creating a pdf reader object
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
# creating a page object
pageObj = pdfReader.getPage(0)
# extracting text from page
text = pageObj.extractText()
print(text)
# closing the pdf file object
pdfFileObj.close()
"""