A lightweight desktop application that converts CSV files to Excel (.xlsx) format while preventing Excel's auto-formatting issues (such as stripping leading zeros from phone numbers or incorrectly parsing dates).
- Drag & Drop UI: Simply drag and drop CSV files into the window to convert them.
- Auto Encoding Detection: Automatically detects and handles UTF-8, UTF-16, and Shift-JIS to prevent garbled text.
- Strict Text Formatting: Specify exact column names to be strictly formatted as Text (
@) in Excel. This preserves leading zeros (e.g.,09012345678) and specific date strings.
This repository contains two implementations:
- Go Edition (
main.go): A compact, native Windows executable (usinglxn/walk). - Python Edition (
main.py): A PyQt5 based implementation.
The Go edition uses lxn/walk for the native Windows GUI. It requires a manifest file to be compiled into the binary.
- Install Go.
- Install the
rsrctool for compiling the manifest:go install github.com/akavel/rsrc@latest
- Compile the manifest file:
rsrc -manifest test.manifest -o rsrc.syso
- Build the executable (hides the console window and reduces file size):
go build -ldflags="-H windowsgui -s -w" -o dist/main.exe .
- Launch the executable (
main.exe). - In the text area, list the column names (one per line) that you want to explicitly format as Text.
- Drag and drop one or more
.csvfiles into the window, or click "ファイルを選択" to browse. - The converted
.xlsxfiles will be saved in the same directory as the original CSV files.
CSVファイルをExcel(.xlsx)形式に変換する軽量なデスクトップアプリケーションです。Excel特有の「おせっかい機能(電話番号の先頭のゼロが消える、日付が勝手に変換されるなど)」によるデータ破損を防ぎます。
- ドラッグ&ドロップ対応: ウィンドウにCSVファイルをドロップするだけで一括変換できます。
- 文字コードの自動判定: UTF-8、UTF-16、Shift-JISなどの文字コードを自動で判定し、文字化けを防ぎます。
- 厳密な文字列フォーマット: 指定したカラム名のデータを、Excel上で強制的に「文字列(
@)」として扱います。これによりゼロ落ち(例:09012345678)や日付の誤変換を防止します。
本リポジトリには2つの実装が含まれています。
- Go言語版 (
main.go):lxn/walkを用いた、軽量でネイティブなWindowsアプリです。 - Python版 (
main.py):PyQt5を用いた実装です。
Go言語版はWindowsネイティブUIライブラリ lxn/walk を使用しています。ビルドにはマニフェストファイルのコンパイルが必要です。
- Go をインストールします。
- マニフェストコンパイル用のツール
rsrcをインストールします。go install github.com/akavel/rsrc@latest
- マニフェストファイルをコンパイルします。
rsrc -manifest test.manifest -o rsrc.syso
- 実行ファイルをビルドします(黒いコンソール画面を非表示にし、ファイルサイズを削減します)。
go build -ldflags="-H windowsgui -s -w" -o dist/main.exe .
- 実行ファイル(
main.exe)を起動します。 - テキストエリアに、強制的に文字列として扱いたいカラム名(ヘッダー名)を改行区切りで入力します。
.csvファイルを画面にドラッグ&ドロップするか、「ファイルを選択」ボタンから選択します。- 元のCSVファイルと同じフォルダに、変換後の
.xlsxファイルが出力されます。
MIT License