How to read the first line of a text document in adobe campaign via javascript coding?
Hi, please help me with this.
Hi, please help me with this.
Hi ,
The following code will print all the lines from a file into the workflow journal logs.
You can customize it to read only the first line
var file = new File( fName );
var arr = [];
file.open();
try
{
for each(var line in file)
{
arr.push( line );
}
for ( var i = arr.length - 1; i >= 0; i-- )
logInfo(arr[i]);
logInfo( "###===== " + fName );
}
finally
{
file.close();
}
Hope this helps.
Regards,
Vipul
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.