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

Unexpected end of file while parsing CSV input - CSVParserFunctions

otluk
14-Alexandrite

Unexpected end of file while parsing CSV input - CSVParserFunctions

PTC ThingWorx Version: 8.4.9 with CSVParser_Extensions

Trying to read and then parse TSV-File.

Can open and read the file with undefined delimiter but as soon as I set the delimter to ";"

 

I get Error executing service TSV_ParserService. Message :: Unable To Open [testFile.tsv] in [TSV_Repository] : Unexpected end of file while parsing CSV input - See Script Error Log for more details.

[L: ERROR] [O: S.c.t.d.e.DSLProcessor] [I: TSV_Parser] [U: Administrator] [S: ] [T: http-nio-8080-exec-7] [message: Execution error in service script [TSV_ParserService] :: Unable To Open [testFile.tsv] in [TSV_Repository] : Unexpected end of file while parsing CSV input]
	at TSV_ParserService:15

 

 

 

var params = {
	path: "testFile.tsv" /* STRING */,
	columnMappings: undefined /* STRING */,
	hasHeader: undefined /* BOOLEAN */,
	longitudeField: undefined /* NUMBER */,
	dateFormat: undefined /* STRING */,
	fileRepository: Things["TSV_Repository"].name /* THINGNAME */,
	latitudeField: undefined /* NUMBER */,
	fieldDelimiter: undefined /* STRING */,
	stringDelimiter: ";" /* STRING */ /* with undefined I can open the file*/,
	dataShape: "TSV_TransferShape" /* DATASHAPENAME */
};

// result: INFOTABLE
var result = Resources["CSVParserFunctions"].ReadCSVFile(params);

 

 I followed this example: http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/#page/ThingWorx%2FHelp%2FExtensibility%2FCSVParser.html%23wwID0E65DVB

 

Some hints (e.g. is encoding like UTF-8 relevant)?

ACCEPTED SOLUTION

Accepted Solutions
CharlesJi
15-Moonstone
(To:otluk)

Hi @otluk, I'm not sure but can you check if your CSV file is separated by ";"? 

 

I think commonly, a CSV (Comma-Separated Values) should use "," to separate its fields.

So the undefined delimiter is "," by default, I guess.

 

View solution in original post

1 REPLY 1
CharlesJi
15-Moonstone
(To:otluk)

Hi @otluk, I'm not sure but can you check if your CSV file is separated by ";"? 

 

I think commonly, a CSV (Comma-Separated Values) should use "," to separate its fields.

So the undefined delimiter is "," by default, I guess.

 

Announcements


Top Tags