Data and Image Preparation

中文

Sheet to Doc is a powerful tool that automatically writes Excel, CSV, JSON, JSONL data into docx format Word templates, converting them into Word documents in batches.

Building on the basis of mail merge, this tool has developed more features, such as custom file names, custom file paths, embedding images, and so on.

Note

This page is quite long, we recommend that you browse this page with the Table of Contents on the left side of the page to help you understand the page structure.

Data Preparation

Before using Sheet-to-Doc, you need to prepare the data that will be converted into documents.

We accept multiple data formats:

  • Tab-separated Excel data (regular Excel files)

  • Comma-separated Excel data (CSV files)

  • JSON

  • JSONL

Data Content

At least two rows and one column of data should be included.

  • Tab-separated Excel data

    • The first row is the header row,

    • Subsequent rows are data rows.

  • Comma-separated Excel data

    • The first row is the header row,

    • Subsequent rows are data rows.

  • JSON

    • Should be an array with at least one element

    • Each element in the array is a JSON object

    • Each JSON object has at least one key-value pair.

  • JSONL

    • Each data row is an independent JSON object,

    • Each JSON object has at least one key-value pair.

Header Row Data Type Requirements

  • Tab-separated Excel data and CSV

    • Each cell in the header row must be in text format (data types other than numbers and booleans are considered text strings)

    • Each cell in the header row cannot be empty text (i.e., no content)

    • Header row cell content can be in Chinese, English, and theoretically supports other languages

    • It is not recommended to include empty characters (spaces, tabs, etc.) in single cell content in the header row

    • Content between cells in the header row cannot be duplicated

    • Spaces, @ , hyphens (-), brackets ((), [], {}), #, $, +,-,*,/,%,=,<,>,!,&,|,^,~,?,:,;,.,’,”,`,,are not allowed in cell content

    • If the header row contains a dot (.), it will be treated as a one-level nested structure (see the simple and advanced examples below to understand the difference). Beginners are advised to use simple data.

  • JSON and JSONL

    • Each key in the JSON object must be in text string format

    • It is not recommended to include empty characters (spaces, tabs, etc.) in each key of the JSON object

    • Keys in each JSON object cannot be duplicated

    • Spaces, @ , hyphens (-), brackets ((), [], {}), #, $, +,-,*,/,%,=,<,>,!,&,|,^,~,?,:,;,.,’,”,`,,are not allowed in key

    • one-level nested structure is supported (e.g., “Name.FirstName”) (see the simple and advanced examples below to understand the difference). Beginners are advised to use simple data.

Data Row Data Type Requirements

  • Tab-separated Excel data and CSV

    • Each cell in the data row must contain text, numbers, or boolean values

    • Some cells in the data row can be empty (i.e., no content)

  • JSON and JSONL

    • The value of each JSON object can be any data type supported by JSON

    • The value of each JSON object can be empty (i.e., no content)

Simple Data Example

Simple data examples are suitable for beginners. They use simple key-value pairs without nested structures.

  • Tab-separated Excel data

    Name    Age    Gender
    Zhang San    25    Male
    Li Si    30    Female
  • Comma-separated Excel data

    Name,Age,Gender
    Zhang San,25,Male
    Li Si,30,Female
  • JSON

    [
        {"Name": "Zhang San", "Age": 25, "Gender": "Male"},
        {"Name": "Li Si", "Age": 30, "Gender": "Female"}
    ]
  • JSONL

    {"Name": "Zhang San", "Age": 25, "Gender": "Male"}
    {"Name": "Li Si", "Age": 30, "Gender": "Female"}

Advanced Data Example

Advanced data examples are suitable for more experienced users. They use nested structures to represent more complex data.

  • dot (.) is taken as delimiter to represent nested structure

  • Tab-separated Excel data

    Person.Name    Person.Age    Person.Gender
    Zhang San    25    Male
    Li Si    30    Female
  • Comma-separated Excel data

    Person.Name,Person.Age,Person.Gender
    Zhang San,25,Male
    Li Si,30,Female
  • JSON

    [
        {"Person": {"Name": "Zhang San", "Age": 25, "Gender": "Male"}},
        {"Person": {"Name": "Li Si", "Age": 30, "Gender": "Female"}}
    ]
  • JSONL

    {"Person": {"Name": "Zhang San", "Age": 25, "Gender": "Male"}}
    {"Person": {"Name": "Li Si", "Age": 30, "Gender": "Female"}}

Data Types

Sheet-to-Doc supports the following data types:

  • Tab-separated Excel data and CSV

    • Numbers (integers, floating points)

    • Boolean values (TRUE/FALSE)

    • Text (strings) (data types other than numbers and booleans are considered text strings)

  • JSON and JSONL

    • Numbers (integers, floating points)

    • Boolean values (TRUE/FALSE)

    • Text (strings)

    • Etc… other data formats supported by JSON

Attention

If a number in a data cell is greater than 10^12 (1,000,000,000,000), it will be treated as a text string.

Image Preparation

If you want to insert images into the Word document generated by Sheet-to-Doc, you need to prepare the images.

We accept multiple image formats:

  • JPEG

  • PNG

  • GIF

  • BMP

  • JPG

Image file size is recommended not to exceed 1MB. It is recommended to compress images using compression tools to reduce file size, otherwise, the generation time will be long and the probability of errors will increase.