0

New to Python and am working with code handed down to perform data scrape on formatted Word documents used in audit final reports. The following code is built to extract an audit code number that begins with the letter 'F' and is 8 characters long:

def get_autid_code(in_file1):
wordDoc = Document(in_file1)
aud_cd=''
result = [p.text for p in wordDoc.paragraphs]
L=len(result)-1
for num in range(L,-1,-1):
    **if result[num][:1] =='F':
        aud_cd=result[num][:8]
        L=num****
        break
    if aud_cd[:1] == 'F':
        break
             
return aud_cd,L,result

My question is how do I admit for the possibility of a document beginning with either an 'F' or 'D'?

Mark
  • 1
  • 1

0 Answers0