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

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

problem with LoadText

iguerra
16-Pearl

problem with LoadText

why when I try to load a particular, very short CSV file (100 bytes) I get this error on application log ?
Execution error in service script [testscript] :: Input length = 3

 

with other files it's OK

ACCEPTED SOLUTION

Accepted Solutions

I found that the problem was due to letter "à" (ascii exdended) on the csv text file, and that file was not saves with UTF-8 encoding but ANSI

Note that this happen with TWX 9.6 , in the past I was using TWX 8.5 and it was working fine

 

Now by saving the csv file with UTF-8 encoding, even with the "à" letter, it loads fine with LoadText

Problem solved

 

 

 

 

View solution in original post

4 REPLIES 4
shandler1
5-Regular Member
(To:iguerra)

Take a look at this support article - Article - CS294337 - How to import text, CSV, or Excel data into ThingWorx. Hopefully that can resolve your issue.

VladimirRosu
19-Tanzanite
(To:iguerra)

Hi @iguerra ,

  1. Can you share the content of your testscript service and the ScriptErrorLog.log lines that correspond to that error?
  2. If you're trying to execute LoadText directly on the CSV file, what result will it give?

Hello @VladimirRosu 

I'm, using loadText, not trying to import the csv data

// Content: STRING
Content = Things["MyRepository"].LoadText({
	path: 'LDP.csv' /* STRING */
});

It seems the content of this particular file cause problem with that function. Function that is working since lot of time.

It is a text file with 2 rows of text, file is present and correct

 

with another text file works with no problems ... really strange !

 

(sorry unfortunatel I pressed the "accepted as solution" button, but I didn't solved)

 

I found that the problem was due to letter "à" (ascii exdended) on the csv text file, and that file was not saves with UTF-8 encoding but ANSI

Note that this happen with TWX 9.6 , in the past I was using TWX 8.5 and it was working fine

 

Now by saving the csv file with UTF-8 encoding, even with the "à" letter, it loads fine with LoadText

Problem solved

 

 

 

 

Announcements


Top Tags