Oct-12-2018, 04:11 PM
I did that in a way:
When I run this I get:
for item in happy_days: the_real_deal = str(base64.b64decode(item).decode()) # print(the_real_deal) testing_the_split = re.split('[\t\r\n]+', the_real_deal) #print(testing_the_split) # list_of_lists = [list(elem) for elem in the_real_deal] # print(list_of_lists) header_list = testing_the_split[:3] parts_list = testing_the_split[7:] print("_" * 45, file=open("output.txt", "a")) print("| Job Number: " + header_list[0], " " * (25 - len(header_list[0])) + "| ", file=open("output.txt", "a")) print("| Job Name: " + header_list[1], " " * (18 - len(header_list[1])) + "| ", file=open("output.txt", "a")) print("| Job Location: " + header_list[2], " " * (17 - len(attachment_all[0][2])) + "| ", file=open("output.txt", "a")) print("*" * 45, file=open("output.txt", "a")) print("| Loc | Part #", " " * (17) + "| Qty |", file=open("output.txt", "a")) print("| " + parts_list[0], " " * (4 - len(parts_list[0])) + "| " + parts_list[1], " " * (23 - len(parts_list[1])) + "| " + parts_list[3], " " * (10 - len(parts_list[3])) + "|", file=open("output.txt", "a")) print("| Description: " + parts_list[2], file=open("output.txt", "a"))I am still not processing beyond 1 part on my list but I have a new problem.
When I run this I get:
Error:Traceback (most recent call last):
File "<input>", line 13, in <module>
File "C:\Users\Kingdel\AppData\Local\Programs\Python\Python36\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\ufeff' in position 14: character maps to <undefined>
This is because when I return the first object in the list it looks like ['\ufeff73543', ...I'm stumped for a simple solution.