当前位置:网站首页>Small programs import Excel data in batches, and cloud development database exports CVS garbled code solution
Small programs import Excel data in batches, and cloud development database exports CVS garbled code solution
2022-06-24 06:12:00 【Programming pebbles】
When we import data into the applet cloud development database , use json It can perfectly avoid the problem of garbled code , But if it's a lot of data , Editing data is more troublesome , It doesn't look very beautiful . So the best way is excel Well edited , Then batch import into the applet database .
If we want to import excel The data of , You have to put excel Convert to csv. In fact, this step is very simple
One , Import excel Data to applet database
First of all , We build a new one excel, Then write your own data . Here's the picture
Then start editing the data
1-1, matters needing attention
1, The first line is your field name in the database
2, The first 2 The beginning of the line is the real data
1-2, edit excel data
As shown in the figure above , Suppose there are three fields in our commodity data table _id,name,price
The first row must be the field in the database , Preferably pinyin or English .
1-3, hold excel Convert to csv Format
When saving as, select the format CVS Of UTF-8( Comma separated )
So let's do that excel Convert to csv Format , Is it simple
1-4, Import csv To the cloud development database
It's edited csv Format data after , You can import it into the database
Choose the one from the previous step Programming little stone .csv
Then wait for the import to complete
The effect picture after import is as follows
Here we are excel The data can be successfully imported into the applet cloud development database .
Two , Applet exported csv Solve the problem of disorderly code
We can also directly export the data in the applet database to excel, But the same question is , Applet database export data can only be exported json perhaps csv.
Actually , Same principle , Let's export it as csv, And then convert it to excel That's all right.
2-1, Export set data to csv
But there's a problem , It's exported csv When , You must fill in the fields to export .
As shown here, I want to import the three fields in the red box in the figure above , Fill in as shown in the figure below . Remember to separate them with commas in English
But there is a problem after the data is opened
2-2, solve csv The code problem
As shown in the figure below , We exported it csv After data opening , There will be garbled Chinese .
This problem is easy to solve .
1, Right click the exported csv file , Open in Notepad
2, After Notepad is opened , Click on the file ---》 Save as
3, Change the encoding format to ANSI
Open it again and you can see that the garbled code problem has been solved
If you want to add data or modify data to the exported data , Remember to repeat the first step excel Convert to csv The steps of format are all right .
Here we can happily import excel To applet database and applet database export to excel 了 .
I think it's good. I can pay attention to brother stone , There will be more and better small program tutorials for you later .
边栏推荐
- Confirm the importance of requirements at the initial stage of EDI project
- EEG microstate as a continuous phenomenon
- Intelligent monitoring era - the way of monitoring construction
- Analysis of official template of micro build low code (I)
- Domain name, resolution, SSL certificate product selection
- What are the domain name registration query tools? What should be paid attention to when registering a domain name
- Idea2020 latest activation tutorial, continuously updated
- MySQL series tutorial (I) getting to know MySQL
- [industry outlook] future development forecast of UHD video application
- Tencent cloud won the "best customer value award for security hosting services in China" from Sullivan toubao Research Institute
猜你喜欢
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database

What is the difference between a white box test and a black box test

ServiceStack. Source code analysis of redis (connection and connection pool)

Technology is a double-edged sword, which needs to be well kept

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing

Solution to the 39th weekly game of acwing

One line of keyboard
随机推荐
Koa middleware implementation
How to select cloud game platforms? Just pay attention to two points
C51 single chip microcomputer, an entry-level tutorial for lighting up small lights
New tea: reshuffle, transformation, merger and acquisition
Increase the dynamic port range to solve TCPIP alarm
Differences between JSON objects and JSON strings
Tencent security monthly report - Tencent security has been selected into several authoritative research reports, a data security special committee has been established, and zero trust specifications
Member management system PC side building tutorial (I)
Summary of basic notes of C language (I)
Continuously evolving cloud native application delivery
Build ZABBIX on Tencent ECS
Playing "honey in snow and ice city" with single chip microcomputer
MySQL forgets root password cracking root password cracking all user passwords, shell script
A letter from little potato
"Adobe international certification" design white must understand the color theory, absolutely full of dry goods
Tencent Youtu presents a number of AI technologies at the 2021 global digital economy conference
Risc-v instruction set explanation (4) R-type integer register register instruction
Working principle and type selection of signal generator
"Adobe international certification" confused me: what is Pantone?
Little transparent apprentice's way to go ashore