I 텍스트 파일 (쉼표로 구분 된 값) 아래 스크린 샷을 현재 기존 워크 시트를로드하고 가져 오기 위해 노력하고 있어요파이썬 던지기, 오류
엑셀 시트 " 'UTF8'코덱의 위치는 0 바이트 0xd0를 디코딩 할 수 없습니다" :
는텍스트 파일 :
내가 코드를 사용하고 벨로 표시 W :
# importing necessary modules for performing the required operation
import glob
import csv
from openpyxl import load_workbook
import xlwt
#read the text file(s) using the CSV modules and read the dilimiters and quoutechar
for filename in glob.glob("E:\Scripting_Test\Phase1\*.txt"):
spamReader = csv.reader((open(filename, 'rb')), delimiter=',')
#read the excel file and using xlwt modules and set the active sheet
wb = load_workbook(filename=r"E:\Scripting_Test\SeqTem\Seq0001.xls")
ws = wb.worksheets(0)
#write the data that is in text file to excel file
for rowx, row in enumerate(spamReader):
for colx, value in enumerate(row):
ws.write(rowx, colx, value)
wb.save()
나는 다음과 같은 오류 메시지가 점점 오전 :
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd0 in position 0: invalid continuation byte
하나 더 질문 : 당신은 어떻게 엑셀 시트에 A3 열에서 시작하는 텍스트 데이터를 가져 Python을 알 수 있습니까?
감사합니다. Adam! 나는 그 일을했지만 여전히 같은 오류를 시도했다. – Raj