Last active
January 28, 2019 04:29
-
-
Save marcorodas/4b912e59df27d2afa3d602960da5b92f to your computer and use it in GitHub Desktop.
EXCEL CSV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TRUNCATE TABLE dua_xlsx; | |
| LOAD DATA | |
| LOCAL INFILE 'C:\\Users\\skynet\\AppData\\Local\\Temp\\dua_xlsx.csv' | |
| INTO TABLE `file_collection`.`dua_xlsx` | |
| CHARACTER SET latin1 | |
| FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' | |
| IGNORE 1 LINES; | |
| SELECT COUNT(*) FROM dua_xlsx; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Install-Module -Name ImportExcel | |
| Import-Module ImportExcel | |
| $in = '.\Trabajada - Importaciones Formulas & Suplementos v8.xlsx' | |
| $out = $env:TMP + '\dua_xlsx.csv' | |
| Import-Excel -Path $in -WorksheetName Data -StartColumn 1 -EndColumn 33 -NoHeader | ConvertTo-Csv -NoTypeInformation | Select-Object -Skip 1 | Set-Content $out |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use UNIX
filecommand to get the file encoding charset.scoop install file... -Encoding UNICODEencodes to Little-endian UTF-16 Unicode charset... -Encoding ASCII(default) encodes to Windows codepage 1252 charset which is equivalent to MySQL's latin1 charset