Jump to content
php.lv forumi

Datu imports no CSV.


Sasa

Recommended Posts

SQL:

 

load data local infile 'C:\\korpus.csv' into table korpus
fields terminated by ','
enclosed by ''
lines terminated by '\n'
(thicknes, name, code)

 

CSV:

1,a,4
2,b,5

 

Pēc importa ir tā ka tur kur jābūt 1 ir 0, un tā ir ar jebko pirmā ieimportētā vērtība ir 0, bet tālāk viss ir kārtībā, tabulas otrā rindā vair nav 0 bet ir tas kam tur jābūt.

Edited by Sasa
Link to comment
Share on other sites

Tavs notepads BOM simbolus loģiski ka nerādīs, ja tie tur būs. Atrodi tā opcijās kā noņem tos. Nezinu kā notepad'am++ to dara, bet notepad2, ko es lietoju, BOM simbolus noņem izvēloties File->Encoding->UTF-8 (bez signature).

Vai arī atver failu kādā hexeditorā vai tamlīdzīgā programmā, kas rādīs faila saturu pa baitiem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...