วิธีแปลง Excel เป็น JSON
ประเด็นสำคัญ
- เลือก
- เลือก JSON
- คัดลอก
You want to turn an Excel table into JSON for use in programs and web services. Choosing "JSON" as the format in Convert Excel to CSV or JSON converts it to JSON with the first row as item names.
ขั้นตอน
- With "Choose one .xlsx Excel file", choose the file.
- Choose the "Sheet".
- Under "Format", choose "JSON".
- The JSON appears under "After conversion".
- Use it with "Copy result" or "Save as file".
The first row becomes the item names. Sheets with headings in the first row suit it.
Conversion example
Excel table:
name | age
Yamada | 30
Sato | 25
JSON: two records, each with the items "name" and "age", lined up.
Excel shapes that suit
- Headings in the first row
- Data lined up from the second row
- Few blank rows and merged cells
Tips for tidying before converting
- Delete title rows above the headings
- Unmerge merged cells
- Give headings unique names
- Delete unneeded columns and rows
Tidying the JSON afterwards
Formatting the JSON with the JSON formatting tool makes it readable and also checks its syntax.
เหมาะกับ
- Turning Excel data into web app data
- Making test data to send to an API
- Managing configuration data in Excel and making it JSON
ตัวอย่าง
Managed a product list in Excel. Converted it to JSON and used it as the product list data for a website.
Common stumbling blocks
- Item names are unexpected: the content of the first row becomes the item names.
- Empty cells: treated as empty values.
- Dates become numbers: see the separate guide.
Frequently asked questions
Are numbers output as numbers?
Yes. Numeric cells are output as numbers.
สรุป
Just choose "JSON" as the format. The first row becomes item names, so use it with tables that have headings.
ใช้ “แปลง Excel เป็น CSV หรือ JSON” (ฟรี)เครื่องมือที่ใช้คู่กันได้ดี
- แปลง CSV เป็น Excel (.xlsx): แปลง CSV เป็นไฟล์ Excel (.xlsx)
- แปลง CSV และ JSON: แปลงระหว่าง CSV และ JSON ได้ทันที
- ดึงข้อความจากไฟล์ Word: ดึงข้อความธรรมดาจากไฟล์ Word
หากคู่มือนี้เป็นประโยชน์ ทิปเล็ก ๆ น้อย ๆ จะเป็นกำลังใจอย่างมาก
ส่งทิป (¥300)ส่งของขวัญ (Amazon wishlist)