cancel
Showing results for 
Search instead for 
Did you mean: 

Read CSV file with SAP iRPA with ctx.fso.file.read

arnefeys
Explorer
0 Kudos
639

Hi,

I am trying to read a csv file with the ctx.fso.file.read function, but it is not outputting anything in the output variable.

The contents of my input file 'variants.csv' file (encoding UTF8):

var1;var2;var3

This is my input to the function:

Which relates to following line of code:

// Read a CSV file.
rootData.SAPData.Variants = ctx.json.CSV2Object(ctx.fso.file.read("C:\\Users\\<user>\\Documents\\Solution CE&O\\Customers\\<customer>\\dumpfolder\\variants.csv", e.file.encoding.UTF8), ';');

But when running the code and putting a watch on the output variable 'Variants', it does not display the values. Only a length parameter does appear:

Did someone encountered this before? Does someone see where I am wrong?

PS: The path to the file is correct, because when I launch the ctx.fso.file.delete with the same parameters, it deletes the file.

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

niladri11
Advisor
Advisor
0 Kudos

Hi Arne,

Could you please try adding the Column name to your CSV file. like:

Title1,Title2,Title3
var1,var2,var3
var4,var5,var6
Thanks,

Niladri

Answers (0)