Reply To: Reading a csv file in JVS Table

Gareth Evenson

Hi Saurabh

You can use these functions with an empty table and they will create the columns.

So if you run this example code:

package com.custom;

import com.olf.openjvs.*;
import com.olf.openjvs.enums.*;

public class TestFileImport implements IScript
public void execute(IContainerContext context) throws OException
Table importTable = Table.tableNew();
String fileName = “C:\\Users\\gevenson\\Documents\\TestFile.csv”;

With a file like this:

value1, value2, value3
value4, value5, value6

Then you get a 3 column table produced with all columns of type string. The header row is not distinguished however so you need to take then first row and rename the columns accordingly.

Download PDF version

This field is for validation purposes and should be left unchanged.