[PYTHON] Convert UTF-8 CSV files to read in Excel

—— That often happens. ――If you have special characters and do it exactly, there may be a replacement table, but if you can see it for the time being, you want to convert it --Something happens every time, so make a note

python


src = open('src.csv')
csv = src.read()
src.close()

csv_utf = unicode(csv, 'utf-8')
csv_sjis = csv_utf.encode('cp932', 'replace')

dest = open('dest.csv', 'w')
dest.write(csv_sjis)
dest.close()

Recommended Posts

Convert UTF-8 CSV files to read in Excel
How to read CSV files in Pandas
2 ways to read all csv files in a folder
[R] [Python] Memo to read multiple csv files in multiple zip files
Batch convert all xlsx files in the folder to CSV files
Read all csv files in the folder
Convert FBX files to ASCII <-> BINARY in Python
Read CSV files uploaded to Flask without saving
Batch convert PSD files in directory to PDF
Convert json to excel
How to convert Json file to CSV format or EXCEL format
How to read csv containing only integers in Python
[Python] Convert Shift_JIS to UTF-8
Convert SDF to CSV quickly
Read json in C # and convert to dictionary type (forced)
Convert only date serial numbers in CSV files with awk
Convert Excel file to text in Python for diff purposes
Transpose CSV files in Python Part 1
Function to convert Excel column to number
Convert markdown to PDF in Python
Handle Excel CSV files with Python
Read files in parallel with Python
Bring files in Windows to WSL
Points to note when making pandas read csv of excel output
Convert files written in python etc. to pdf with syntax highlighting
Read big endian binary in Python and convert it to ndarray
[For beginners] Read Excel / CSV files into DataFrame with Google Colaboratory
[Good By Excel] python script to generate sql to convert csv to table
[Python] How to convert db file to csv
Convert PDF of available stores of Go To EAT in Kagoshima prefecture to CSV
[Python] Convert csv file delimiters to tab delimiters
Convert from PDF to CSV with pdfplumber
Convert XML document stored in XML database (BaseX) to CSV format (using Python)
Convert psd file to png in Python
To set default encoding to utf-8 in python
Convert Excel data to JSON with python
Automatically update CSV files to AWS DynamoDB
I want to convert a table converted to PDF in Python back to CSV
Read and write csv files with numpy
Read Python csv and export to txt
Read and write JSON files in Python
I made a script in python to convert .md files to Scrapbox format
Convert PDF files to PNG files with GIMP
Read CSV file with Python and convert it to DataFrame as it is
Convert HEIC files to PNG files with Python
Convert multiple CSVs to each Excel sheet
Convert files uploaded to Cloud Storage with Cloud Functions (Python) so that they are not garbled in Excel
How to convert DateTimeField format in Django
Convert from Markdown to HTML in Python
Convert PDF of Go To EAT member stores in Ishikawa prefecture to CSV
Control files to build in Golang project
Convert PDF of new corona outbreak case in Aichi prefecture to CSV
Convert absolute URLs to relative URLs in Python
Books on data science to read in 2020
Convert PDF of list of Go To EAT member stores in Niigata prefecture to CSV
How to read a CSV file with Python 2/3
Convert "number" of excel date to python datetime
Convert PDFs to images in bulk with Python
I want to visualize csv files using Vega-Lite!
[Python] How to read excel file with pandas
How to check / extract files in RPM package