Import an Excel Sheet from O365, convert it to csv and Import the data into an sqlite Database!
Last active
February 20, 2021 16:15
-
-
Save jtuttas/013fb27b6921f3548cbc5dfa71ea53de to your computer and use it in GitHub Desktop.
O365Excel2SQLite
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
Invoke-WebRequest -Uri "https://multimediabbshannover-my.sharepoint.com/:x:/g/personal/tuttas_mmbbs_de/EUB9Zr7V_m5AkO-JdwTnu-8BF3W4l5OIZ8-KccOz_vno6w?download=1" -OutFile "$env:TEMP/test.xlsx" | |
import-excel "$env:TEMP/test.xlsx" | ConvertTo-Csv -NoTypeInformation | % {$_ -replace '"',''} | Select-Object -Skip 1 | Set-Content "$env:TEMP/test.csv" | |
C:\Users\jtutt\ownCloud\bin\SQLite\sqlite3.exe C:\Users\jtutt\Downloads\test.db 'delete from test' | |
$file = "$env:TEMP\test.csv" | |
$file=$file.Replace("\","\\") | |
$params = @" | |
.mode csv | |
.separator , | |
.import $file test | |
"@ | |
$params | C:\Users\jtutt\ownCloud\bin\SQLite\sqlite3.exe C:\Users\jtutt\Downloads\test.db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment