मैं एक वर्तमान में मौजूदा कार्यपत्रक लोड और पाठ फ़ाइल (कॉमा सेपरेटेड वैल्यू) स्क्रीनशॉट नीचे दिखाया गया है आयात करने के लिए कोशिश कर रहा हूँ " '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
एक और सवाल: आप कैसे एक्सेल शीट में ए 3 स्तंभ से शुरू पाठ डेटा आयात करने के अजगर बता सकते हैं?
धन्यवाद, एडम! मैंने बस ऐसा करने की कोशिश की लेकिन फिर भी वही त्रुटि। – Raj