cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

WriteCSVFile

AP_9587236
17-Peridot

WriteCSVFile

I have 100 rows in CSV File. I want to replace only one row. This snippet: Resources["CSVParserFunctions"].WriteCSVFile(params2); is not accepting one row as an input. Iam getting an error "JavaException: java.lang.Exception: Unable To Convert From com.thingworx.types.collections.ValueCollection to INFOTABLE ". 

1. How to update only one row of csv file?

 

2. Shall i pass arrays tothe input data?

 var params2 = {
path: filePath2 /* STRING */,
data: rowCSV /* INFOTABLE */,
fileRepository: "SystemRepository" /* THINGNAME */,
withHeader: true /* BOOLEAN */
};Resources["CSVParserFunctions"].WriteCSVFile(params2);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:AP_9587236)

Hi @AP_9587236.

 

You will need to load the whole file into a ThingWorx infotable, Is it a correct assumption that you would want to make the updates via a mashup?  If so, you would need to tie the infotable to a grid, make the change, and then write it back out to the CSV file.

 

If you can provide a better understanding of your application, we might be able to provide a more efficient way of handling it.

 

Regards.

 

--Sharon

View solution in original post

2 REPLIES 2
slangley
23-Emerald II
(To:AP_9587236)

Hi @AP_9587236.

 

You will need to load the whole file into a ThingWorx infotable, Is it a correct assumption that you would want to make the updates via a mashup?  If so, you would need to tie the infotable to a grid, make the change, and then write it back out to the CSV file.

 

If you can provide a better understanding of your application, we might be able to provide a more efficient way of handling it.

 

Regards.

 

--Sharon

slangley
23-Emerald II
(To:slangley)

Hi @AP_9587236.

 

If the previous response answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Top Tags