csvgen


Follow
0
Star
0
Details
Version history
Issues

What's new in this version

Guess on datatypes feature is introduced.

module to generate and import csv data using InterSystems ObjectScript

csvgen

This is not very clever but working util to generate class and import data from an arbitrary CSV. It can import from file or from public URL

Installation with ZPM

zpm:USER>install csvgen

Usage

Generate and import from CSV file

USER>do ##class(community.csvgen).Generate("/folder/filename.csv")

This will parse csv with "," as delimeter, generate class "csvgen.filenameYYYYMMDD" and import the data from file It tries to "guess" the datatype upon the data in first 4 rows. pass the 3-rd parameter as 0 if you want all the datatypes be as "%String MAXLEN=250" The class will have Import method to make more imports from the file with the same structure. With parameters to the Generate method you can alter delimeter, classname and get the number of imported records.

Generate and import from URL

USER>do ##classs(community.csvgen).GenerateFromURL("example.com/data/filename.csv")

This will do the same as above with the same parameters, but from URL in the Internet, which is publicly avaliable. it will use SSL connection, with "default" SSL, but you can alter this.

COLLABORATION

Collaboration to this util is very welcome! This repository is dockerised to make the collaboration easy.

Installation for collaboration

Fork the repository and then clone/git pull the repo into any local folder:

$ git clone git@github.com:yourrepository/csvgen.git

Open the folder in VSCode and run in VSCode Terminal:

$ docker-compose up -d

and the following to open InterSystems IRIS terminal:

$ docker-compose exec iris iris session iris

If you don't have VSCode yet, install VSCode and ObjectScript plugin and open the folder in VSCode.

Pull Requests are welcome!

Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for Health
Tags
Info
Version
1.1.0
Last updated
2020-05-24
Repository
Open
Documentation
Open
License
Link