Methods to persist CSV data using PowerShell on Linux?

三世轮回 提交于 2020-12-15 04:54:47

问题


From Linux, might there be a "native" or built-in convenient "database" facility from withing Powershell itself?

While this works fine for importing data:

nicholas@mordor:~/csv$ 
nicholas@mordor:~/csv$ ll BCCDC_COVID19_Dashboard_Lab_Information.csv 
-rw-rw-r-- 1 nicholas nicholas 89153 Nov 22 05:16 BCCDC_COVID19_Dashboard_Lab_Information.csv
nicholas@mordor:~/csv$ 
nicholas@mordor:~/csv$ pwsh
PowerShell 7.1.0
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS /home/nicholas/csv> 
PS /home/nicholas/csv> $labs=import-Csv labs.csv
PS /home/nicholas/csv> 

this was just so surprisingly simple and gives such at least human readable results:

..
Date        : 2020-11-19
Region      : Vancouver Coastal
New_Tests   : 2923
Total_Tests : 337615
Positivity  : 5.12
Turn_Around : 28.5

Date        : 2020-11-19
Region      : Vancouver Island
New_Tests   : 1682
Total_Tests : 118623
Positivity  : 1.4
Turn_Around : 12.7


PS /home/nicholas/csv> 

perhaps there's a utility even "lighter" than SQLite.

Using Linux, aside from persisting to a mainstream RDBMS such as:

  • MySQL
  • Postgres
  • SQLite

how else might data such as this be persisted?

I'm more interested in retrieving such data.

来源:https://stackoverflow.com/questions/64964864/methods-to-persist-csv-data-using-powershell-on-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!