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

Unexpected end of file while parsing CSV input - CSVParserFunctions

SOLVED
otluk
Amethyst

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%2F...

 

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

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Unexpected end of file while parsing CSV input - CSVParserFunctions

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

Re: Unexpected end of file while parsing CSV input - CSVParserFunctions

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

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.