python:exelprocess
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
python:exelprocess [2020/11/07 12:20] – [Exel Processing] admin | python:exelprocess [2021/05/22 07:30] – [Error Parse UTF-8 file] admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Exel Processing ====== | ====== Exel Processing ====== | ||
- | ===== Function | + | ===== Function |
- | Trước khi xử lý các hàm tìm kiếm trong exel cần phải format dữ liệu và sort trước -> Lúc đó hàm xử lý mới chạy đúng | + | Trước khi xử lý các hàm tìm kiếm |
+ | VLOOKUP($B2, | ||
===== Install ===== | ===== Install ===== | ||
* Install on windows:< | * Install on windows:< | ||
Line 121: | Line 122: | ||
parsexls(constantsfile) | parsexls(constantsfile) | ||
</ | </ | ||
+ | ==== Error Parse UTF-8 file ==== | ||
+ | < | ||
+ | UnicodeDecodeError: | ||
+ | </ | ||
+ | You can debug for information:< | ||
+ | xlsfile = xlrd.open_workbook(filename, | ||
+ | </ | ||
+ | BOF: op=0x0809 vers=0x0600 stream=0x0005 buildid=14420 buildyr=1997 -> BIFF80 | ||
+ | CODEPAGE: codepage 1200 -> encoding ' | ||
+ | DATEMODE: datemode 0 | ||
+ | </ | ||
+ | |||
+ | **Fix**: Lỗi do file exel, copy trực tiếp file exel gốc qua xử lý sẽ không bị lỗi(Chỉ cần lấy file export từ sapo và lưu lại thì sẽ parse lỗi) | ||
+ | Or | ||
+ | <code python> | ||
+ | def open_workbook(filename=None, | ||
+ | logfile=sys.stdout, | ||
+ | verbosity=0, | ||
+ | use_mmap=True, | ||
+ | file_contents=None, | ||
+ | encoding_override=None, | ||
+ | formatting_info=False, | ||
+ | on_demand=False, | ||
+ | ragged_rows=False, | ||
+ | ignore_workbook_corruption=False | ||
+ | </ | ||
===== Using xlwt ===== | ===== Using xlwt ===== |
python/exelprocess.txt · Last modified: 2022/10/29 16:15 by 127.0.0.1