Hi,
I am trying to import a csv file using an ideascript. I understand that there needs to be a corresponding rdf file otherwise the import wont work. Is there a way to create the rdf file using ideascript?
thanks,
Mike
mikew
Offline
Last seen: 7 months 1 week ago
Joined: 09/25/2019 - 08:25
Hi mikew,
the easiest way to create the rdf file would be to import the csv file one time manually. As one of the last steps you will be able to save the rdf file. If you are using IDEA 10.4 (and higher) otherwise have a look on the CSVDefinition-Object.
thanks klmi!!
I was hoping to write a script that could import say all csv files in a folder rather than having to manully import each file. Is this not possible?
I didn't write that's not possible to do such batch imports with IDEA however your question above referred only to the creation of the rdf file!
As you wrote you would need a rdf file as import definition. You can create that rdf file manually and then use it with your script for multiple imports. Regardless to say that all csv files should have the same structure because if not a script really makes no sense.
If you don't want to create the rdf file manually the CSVDefinition-Object gives you the opportunity set delimiters and so on by your code.
When it comes to the batch import of all files from a given folder the Dir-Object will help you in this project.
thanks, apologies for the confusion. I am very new to using IDEA. Is there documentation somewhere that tells me how to use CSVDefinition-Object or the Dir-Object?
thanks for your help
Yes there is! Have you ever tried IDEA's online help / object catalogue? There you will find an example to the object methods.
Hi klmi, thanks for your help. I have not been able to find an object catalogue or CSVDefinition-Object. I have tried to find this in IDEA Help (language explorer) as well as support.casewareanalytics.com (which I assume is the online help?). If you could point me in the right direction that would be extremely helpful?
thanks again,
Mike
Hi Mikew,
You can only create an RDF through script with version 10.4 or higher. If you want to perfrom an import of a CSV with a version prior to 10.3 then you will have to first manually create the RDF file.
In the language browser, if you have 10.4, here is some example code for creating a RDF file. It is under the CSV Definition object.
thanks Brian, this explains my issue. I have an earlier version of IDEA!