Understand the CSV file and how to create a product CSV file

Modified on: Wed, 31 Jul, 2019 at 2:02 PM


In this article:

A. Definition of CSV files  

B. Import and export CSV files into Google Sheets

C. Create a product CSV file 

D. Add images for your CSV file


CSV (comma-separated values) files are used to import and export products of your store. They allow importing and exporting large numbers of products and their details at a time, which's really helpful if you want to migrate bulk product information between ShopBase and another system. 


A. Definition of CSV files  

CSV is short for comma-separated values, a file format (.csv) for spreadsheets. You can use CSV files to import and export products, customers, inventory, orders (export only), and discounts (export only).

They can be useful in many situations, such as when you are switching to ShopBase from another e-commerce platform, or when you need to import a list of customer accounts as well as upload products by using a spreadsheet.

CSV files might seem intimidating at first, but after spending some time to understand their format and how they work, you might find them come in handy. 

Your CSV files must use UTF-8 encoding.

Note: 

If you are updating a CSV file export, remember to confirm the UTF-8 encoding to avoid generating unwanted special characters in your file. If you save your file after forgetting to confirm its UTF-8 encoding, your data will be corrupted when you upload it as a new spreadsheet. Corrupted files cannot be recovered. 

In a CSV file, each entry represents a cell in a spreadsheet, each line represents a row, and each comma indicates where one entry ends and another one begins.

For example, the entries in this customer CSV file:

CSV

look like this in a spreadsheet program: 

CSV

We recommends that you use Google Sheets to work with your CSV files. To use Google Sheets, you must import the CSV file into the program. After you've made your changes, export the CSV file to your computer. Special characters don't always work correctly in CSV files that are exported, edited with another spreadsheet program, and then re-imported into ShopBase.


B. Import and export CSV files into Google Sheets

Importing CSV files walk-through:

  1. Log in to your Google account.

  2. On the Google Sheets page, click Blank in the Start a new spreadsheet section. 

  3. From the Untitled Spreadsheet page, go to File > Import...

  4. Locate and select the CSV file that you want to edit.
  5. In the Import file dialog, select your preferred options under the Import action, Separator character, and Convert text to numbers and dates sections.

  6. Click Import. 

Your CSV will look like this after you've uploaded it: 

CSVFrom here you can start editing your CSV. export it from Google Sheets as a .csv file.

Exporting CSV files walk-through:

From your CSV spreadsheet page, go to File > Download as > Comma-separated values (.csv, current sheet):

CSV

You can find the exported CSV file your downloads folder. 


C. Create a product CSV file

First, you can download and view a sample product CSV file to use as a template and learn more about Product CSV file format

Each product can be a simple product or one with variants:

  • Simple product: If you upload a product with no variants, enter all the fields for the product on the first line along with the URL for the first image. On the following lines, enter just the handle and the URL for each additional image.
  • Product with variants: If you are upload a product that has variants, enter all the fields for the product on the first line along with the URL for the first image. On the following lines, enter the handle. Then, skip the Title, Body (HTML), Vendor, and Tags columns. Fill out the rest of the variants' details and each image URL.

After you've added all your products and images, save your CSV file in UTF-8 format using LF-style linefeeds. 


D. Add images for your CSV file

Because a CSV file can only contain text, you'll need to make sure that all product images are on an existing website. Those image URLs will only be used during the CSV importing process and you can delete them when your import is done. 

  • If the files are on your computer, you need to upload them to your ShopBase store or another image hosting service to link to their URL.

  • If you are switching to ShopBase from another platform, you can copy the current image URLs and use them in the CSV file.

  • If the product CSV file was produced by exporting your products from ShopBase, you don't need to do anything since your images are already on your website.

When you have URLs for each product image, you can start building your CSV file.

Note: If you remove products or product images from your store after exporting and then try to import those products without updating their image URLs, your import will fail.

You can add multiple product images to your CSV by uploading more images to your ShopBase admin but your product images must be uploaded to a publicly accessible URL, meaning that they should be behind an https:// protocol with no password protection. 

Adding images walk-through: 

Step 1: Insert new rows (one per picture)

  • Open your CVS files in Google Sheets.
  • Locate the product(s) you want to add images to.
  • On the next row click and drag on the row numbers to select multiple rows. Select the same number of rows as the number of additional images you will add.
  • While those rows are highlighted, right click anywhere in the highlighted area, and choose Insert X rows above. While those rows are highlighted, right click anywhere in the highlighted area, and choose Insert X rows above. 

Step 2: Copy + Paste the "Handle"

  • Copy and paste the "Handle" of the desired product into column A for your new rows. 

Step 3: Copy + Paste the Image URLs

  •  Upload your images.
  • Highlight and copy one image URL at a time. 
  • Return to your spreadsheet software and scroll sideways to the final columns of the CSV file. 
  • In the column "Image Src" (short for "Image Source"), paste one image URL into each line. 
  • Repeat these steps till all images of the product are uploaded. 

After this, you can then save the file and import it to ShopBase.


If you need our assistance with the steps, don't hesitate to shoot an email. We are here to help!

ShopBase team.


Did you find it helpful? Yes No

Can you please tell us how we can improve this article?