Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
I am trying to create a java code to read a csv file. The file is located in the systemrepository.
I am using the below code, but unable to get the result
DataShapeDefinition dsd = new DataShapeDefinition();
dsd.addFieldDefinition(new FieldDefinition("Field1", BaseTypes.STRING));
dsd.addFieldDefinition(new FieldDefinition("Field2", BaseTypes.STRING));
dsd.addFieldDefinition(new FieldDefinition("Field3", BaseTypes.STRING));
//mything.get
CSVParser csvParser = new CSVParser();
InfoTable csvInfotable = new InfoTable();
csvInfotable.setDataShape(dsd);
_logger.warn("InfotableCreated");
try {
csvInfotable = csvParser.ReadCSVFile("SystemRepository", "/new 1.csv", "TestDataShape",
hasHeader, columnMappings, null, null, dateFormat, ",", "\"");
_logger.warn("InfotableCreated after readCSV function");
//code to identify the memory usage
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The error i am getting is: com.thingworx.common.exceptions.InvalidRequestException: Unable To Open [/new1.csv] in [SystemRepository] : null
attached is the sample csv file
Any help in this matter would be appreciated.
Solved! Go to Solution.
Hi Vatsal,
I came across following which might help you progress?
Best,
abarki
Hi Vatsal,
I came across following which might help you progress?
Best,
abarki