cancel
Showing results for 
Search instead for 
Did you mean: 

How to append text to a Text file in SAP IRPA

0 Kudos

I having a text file (named: Sample.txt) which has some content in it, I need to append some words or lines on the same text file in SAP IRPA.

Accepted Solutions (1)

Accepted Solutions (1)

former_member637907
Discoverer

Hello Mr. Kowtham,

there are two possibilities:

1. You use the integrated FSO library (https://help.sap.com/viewer/dbe2687952b8433a953c6b6305429122/Cloud/en-US/4947f288eee14c07bd41b6e4654...😞

 var file = '...';
 var txt = '...';
 ctx.fso.file.write( file, txt, e.file.encoding.UTF8 );

2. You create your own fso Object:

var fso = new ActiveXObject("Scripting.FileSystemObject");
var filepath = fso.GetFile("C:\\temp\\Sample.txt");
var fileObject = fso.OpenTextFile(filepath, 8);
fileObject.WriteLine("Your text");
fileObject.WriteLine("second line");
fileObject.WriteLine("and the third");
fileObject.close();

Best regards,

Alois Windholz

0 Kudos

Its working..! Thank you so much...

Answers (0)