Guruh talabasi Abdig’opporov javoxir Mysql 1-2-amaliy ishlar


COLUMNS TERMINATED BY ','



Download 353,77 Kb.
bet17/43
Sana18.07.2022
Hajmi353,77 Kb.
#818857
1   ...   13   14   15   16   17   18   19   20   ...   43
Bog'liq
311-18 AJ

COLUMNS TERMINATED BY ','
LINES TERMINATED BY '\r\n';
(For Macs)
mysql> LOAD DATA LOCAL INFILE '~/Documents/products_in.csv' INTO TABLE products
COLUMNS TERMINATED BY ',';
mysql> SELECT * FROM products;
+-----------+-------------+-----------+----------+-------+
| productID | productCode | name | quantity | price |
+-----------+-------------+-----------+----------+-------+
| 1007 | PEC | Pencil 3B | 500 | 0.52 |
| 1008 | PEC | Pencil 4B | 200 | 0.62 |
| 1009 | PEC | Pencil 5B | 100 | 0.73 |
| 1010 | PEC | Pencil 6B | 500 | 0.47 |
+-----------+-------------+-----------+----------+-------+
Notes:

  • You need to provide the path (absolute or relative) and the filename. Use Unix-style forward-slash '/' as the directory separator, instead of Windows-style back-slash '\'.

  • The default line delimiter (or end-of-line) is '\n' (Unix-style). If the text file is prepared in Windows, you need to include LINES TERMINATED BY '\r\n'.

  • The default column delimiter is "tab" (in a so-called TSV file - Tab-Separated Values). If you use another delimiter, e.g. ',', include COLUMNS TERMINATED BY ','.

  • You need to use \N for NULL.

mysqlimport Utility Program
You can also use the mysqlimport utility program to load data from a text file.
-- SYNTAX
> mysqlimport -u username -p --local databaseName tableName.tsv
-- The raw data must be kept in a TSV (Tab-Separated Values) file with filename the same as tablename
-- EXAMPLES
-- Create a new file called "products.tsv" containing the following record,
-- and saved under "d:\myProject" (for Windows) or "Documents" (for Mac)
-- The values are separated by tab (not spaces).
\N PEC Pencil 3B 500 0.52
\N PEC Pencil 4B 200 0.62
\N PEC Pencil 5B 100 0.73
\N PEC Pencil 6B 500 0.47



Download 353,77 Kb.

Do'stlaringiz bilan baham:
1   ...   13   14   15   16   17   18   19   20   ...   43




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish