当前位置:网站首页>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 .
边栏推荐
- An indoor high-end router with an external cable bundle limiting mechanism
- Architecture: rest and HATEOAS
- Tencent Youtu presents a number of AI technologies at the 2021 global digital economy conference
- Clickhouse alter table execution process
- A high-end router antenna connection mechanism that can simultaneously deploy and store antennas
- How to buy a domain name? How to do a good job in website construction?
- Intranet environment request Tencent cloud 3.0 API details
- Analysis of official template of micro build low code (I)
- Optimized the search function of broken websites
- Analysis of DDoS attack methods
猜你喜欢
![[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

One line of keyboard

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

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

Technology is a double-edged sword, which needs to be well kept
随机推荐
ZABBIX enterprise distributed monitoring
Solution to the 39th weekly game of acwing
A power modem that can adjust the bending range of cable
Idea2020 latest activation tutorial, continuously updated
Oceanus practice - develop MySQL CDC to es SQL jobs from 0 to 1
Tencent Youtu presents a number of AI technologies at the 2021 global digital economy conference
Intranet environment request Tencent cloud 3.0 API details
[fault announcement] one stored procedure brings down the entire database
The basic concept of network is the relationship among services, protocols, processes and ports.
12. Tencent cloud IOT device side learning -- NTP function and Implementation
Project deployment for learning 3D visualization from scratch
The website cannot be opened after windows installs the dongle
At the beginning of the school season, use this template to improve the management level
Collateral damage from DDoS and hacktivism
Is the prospect of cloud computing in the security industry worth being optimistic about?
Tensorflow daily essay (I)
Progress update | optimization and upgrading of shard nodes
Ups and esxi realize automatic shutdown after power failure
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
A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing