Written by

Technical Consultant at Traverse Health
Question Muhammad Waseem · Oct 11, 2021

How to import CSV file data to a container class from github repository?

Hi,

I have CSV file in github repository. I want to import CSV file data into container class during running container. 

Thanks

Comments

Sergei Shutov · Oct 12, 2021

Hi Muhammad,

You should look at csvgen package by @Evgeny.Shvarovhttps://github.com/evshvarov/csvgen

There are a few examples of importing data from GitHub on the home page. You can have a look at the source code to see how it's done if you need more flexibility.

0
Evgeny Shvarov  Oct 12, 2021 to Sergei Shutov

Thanks, @Sergei Shutov!

@Muhammad Waseem, with csvgen you can import a CSV on GitHub with one line. 

E.g. here is the command line to import titanic.csv:

USER>d ##class(community.csvgen).GenerateFromURL("https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",",","Data.Titanic")
0
Muhammad Waseem  Oct 13, 2021 to Evgeny Shvarov

Hi @Evgeny Shvarov,


Please review the below snapshot

How can I refer "test_banzai7.csv" file as do ##class(community.csvgen).Generate("test_banzai7.csv") command does not work.

Thanks

0
Muhammad Waseem  Oct 13, 2021 to Muhammad Waseem

got it and it works fine. Thanks

0
Evgeny Shvarov  Oct 13, 2021 to Muhammad Waseem

Great! In other cases, if you want a quick chat or a voice call, ping me on DC Discord

0