シートをCSVで保存する
- 選ぶ
- 保存する
Excelのシートを、CSVで保存したい。CSVは、多くのシステムやソフトで読み込める、シンプルな形式です。Excelをシートごとに分ける で「CSV」を選ぶと、シートごとのCSVファイルが、ZIPにまとまります。
手順
- 「Excelファイルを選ぶ」で、.xlsx を選びます。
- 「保存する形式」で「CSV」を選びます。
- 「シートごとに分けてZIPで保存」を押して、ZIPを保存します。
- ZIPを開いて、中のCSVを確かめます。
CSVに向いている用途
- 会計・販売管理などのシステムへの取り込み
- プログラムやデータベースでの利用
- 軽く、扱いやすい形で渡したいとき
CSVにするときの注意
- 計算式は、計算結果の値になる
- 先頭が0の数字は、Excelで開き直すと、0が消えることがある
- 日付の形式が、変わって見えることがある
- 文字化けする場合は、文字コードを変換するツールを使う
文字化けしたとき
ExcelでCSVを開くと、日本語が化けることがあります。その場合は、文字コードの変換ツールで、Excel向けのUTF-8(BOM付き)にして、開き直します。
向いている場面
- 各シートを、システムに1つずつ登録したい
- 表のデータだけを、軽く保管したい
例
商品マスタのExcelの「商品」シートだけを、販売システムに取り込みたかった。CSVで分けて、そのシートのファイルだけを使った。
つまずきやすい点
- 複数のシートが入っていて、どれか分からない:ファイル名が、シートの名前になる。
- 0が消える:CSVを、Excelで開き直さず、テキストとして扱う。
よくある質問
1つのシートだけを取り出せますか?
ZIPの中から、必要なファイルだけを使います。
まとめ
システム向けならCSV。書式は消えるので、保存前に用途を確かめましょう。
Excelをシートごとに分けるを使う(無料)あわせて使えるツール
- ExcelをCSV・JSONに変換する:Excelのシートを、CSV・TSV・JSONに変換します。
- CSVをExcelファイルにする:CSVを、Excelで開ける .xlsx ファイルにします。
- Excelの計算式を値にする:Excelの計算式を消して、結果の値だけにします。
同じツールの、ほかの解説
Saving Sheets as CSV
- Choose
- Save
You want to save Excel sheets as CSV. CSV is a simple format readable by many systems and programs. Choosing "CSV" in Split an Excel File by Sheet bundles a CSV file per sheet in a ZIP.
Steps
- Choose an .xlsx with "Choose an Excel file".
- Choose "CSV" under "Save format".
- Press "Split by sheet and save as ZIP" and save the ZIP.
- Open the ZIP and check the CSVs inside.
Uses CSV suits
- Importing into accounting or sales-management systems
- Use in programs and databases
- Handing over in a light, easy-to-handle form
Cautions when making CSV
- Formulas become their calculated values
- Numbers with leading zeros may lose the zeros when reopened in Excel
- Date formats may look changed
- If garbled, use the character-encoding conversion tool
When garbled
Opening a CSV in Excel can garble Japanese. In that case, convert to Excel-friendly UTF-8 (with BOM) using the encoding conversion tool and reopen.
Good for
- Registering each sheet in a system one by one
- Keeping only the table data in a light form
Example
Wanted to import only the "Products" sheet of a product-master Excel into a sales system. Split to CSV and used only that sheet's file.
Common stumbling blocks
- Many sheets and can't tell which is which: the file name is the sheet's name.
- Zeros disappear: don't reopen the CSV in Excel; treat it as text.
Frequently asked questions
Can I extract just one sheet?
Use only the file you need from the ZIP.
Summary
CSV for systems. Formatting is lost, so check the purpose before saving.
Use "Split an Excel File by Sheet" (free)Tools that go well with this
- Convert Excel to CSV or JSON: Convert an Excel sheet to CSV, TSV or JSON.
- Convert CSV to Excel (.xlsx): Convert a CSV to an Excel (.xlsx) file.
- Convert Excel Formulas to Values: Replace Excel formulas with their values.