CSV (シーエスブイ) ファイルは、メモ帳、Sublime (サブライム) 、TextEdit (テキストエディット) などのテキスト系アプリで開いた場合、先頭のゼロが保持されます。ただし、Excel (エクセル) と Google スプレッドシート (グーグルスプレッドシート) では、以下に示すようにフォーマットされていない限り、ファイルの保存後に先頭のゼロが削除されます。
これは Excel / スプレッドシートの機能であり、Salesforce (セールスフォース) ではこの機能を制御できません。カスタム書式を設定し、 ファイルの先頭のゼロを復元し、Salesforce へのインポート時に期待どおりの値を取得するための手順を以下に示します。
CSVファイルに先頭にゼロを含むフィールドがある場合、まずはメモ帳や Sublime などのテキストエディタでファイルを開いて、先頭にゼロが含まれているかどうかを確認できます。それから Salesforce でファイルを適切にインポートします。CSV ファイルを Excel で開いて保存する場合は、先頭のゼロを保持したまま Salesforce に正しくインポートするために、以下の手順を実行する必要があります。
以下の手順は、Excel のカスタムフィールドを使用して先頭のゼロを表示する方法の一例です。先頭のゼロを保持する方法については、Microsoftのサポートページ をご覧ください。
1. CSV ファイルを開いたら、列の文字を右クリックし、[セルの書式設定] を選択します。
2. [セルの書式設定] ウィンドウで、[カスタム] を選択します。 たとえば、長さが 8 のフィールドを表すには、書式を「00000000」に設定します。0 の数は、0 を含めた、フィールドに必要な文字数を示します。フィールド値が 012345 の場合、カスタム書式は 0 を含む 6 桁を示すために「000000」にする必要があります。
3. ファイルを .CSV として保存します。
注: 上記の手順は、Excel で先頭のゼロを表示するための 1 つの方法にすぎません。 これらの手順は、Excel などのスプレッドシート プログラムで CSV ファイルを再度開くたびに実行する必要があります。メモ帳や macOS TextEdit.app などのテキスト エディターで CSV を開くと、先頭のゼロが表示されます。
Excel または Google スプレッドシート で先頭のゼロを維持するためにフィールドを書式設定するさまざまな方法の詳細については、Microsoft または Google の Web サイトにアクセスしてください。
000387891

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.